public static void UpdateThrow(string commandString) { try { var cmd = new OleDbCommand(commandString, dbConnection); cmd.ExecuteNonQuery(); } catch (Exception ex) { var frmShowError = new frmShowError { MensajeError = ex.Message, SentenciaError = commandString }; frmShowError.ShowDialog(); throw; } }
public static bool Update(string commandString) { try { var cmd = new OleDbCommand(commandString, dbConnection); cmd.ExecuteNonQuery(); return(true); } catch (Exception ex) { var frmShowError = new frmShowError { MensajeError = ex.Message, SentenciaError = commandString }; frmShowError.ShowDialog(); return(false); } }
public static DataSet FillDataSet(string commandString, string nombreTabla) { if (dbConnection == null) { ConnectDB(); } try { dbDataSet = new DataSet(); dbDataAdapter = new OleDbDataAdapter(commandString, dbConnection); dbDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; dbDataAdapter.Fill(dbDataSet, nombreTabla); return(dbDataSet); } catch (Exception ex) { var frmShowError = new frmShowError { MensajeError = ex.Message, SentenciaError = commandString }; frmShowError.ShowDialog(); return(null); } }