Beispiel #1
0
 private static bool ExecuteCommand()
 {
     try
     {
         using (SqlProxyCommand MyCommand = new SqlProxyCommand(sbuilder.ToString(), GlobalInfo.DBaseInfo.dbManager.DB_Connection))
         {
             MyCommand.ExecuteNonQuery();
         }
         return(true);
     }
     catch (System.Exception ex)
     {
         System.Diagnostics.Debug.Assert(false, ex.ToString(), sbuilder.ToString());
         return(false);
     }
 }
        private static void DeleteData(string tableName)
        {
            var query = $"DELETE FROM {tableName}";

            using (var sqlCM = new SqlProxyCommand(query, GlobalInfo.DBaseInfo.dbManager.DB_Connection))
            {
                try
                {
                    sqlCM.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.StackTrace, e.Message);
                    MessageBox.Show(e.StackTrace, e.Message);
                }
                finally
                {
                }
            }
        }
Beispiel #3
0
 public int ExecuteNonQuery()
 {
     scc.CommandText = Query;
     return(scc.ExecuteNonQuery());
 }