Пример #1
0
 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;
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
        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);
            }
        }