Esempio n. 1
0
 public bool ModifyTable()
 {
     try
     {
         cmd.ExecuteNonQuery();
         return(true);
     }
     catch (Exception ex)
     {
         DebugErrorHelper.WriteErrorLog(ex.Message);
         DebugErrorHelper.WriteErrorLog(ex.StackTrace);
         return(false);
     }
     return(false);
 }
Esempio n. 2
0
        public Dictionary <string, string> ModifyRelationTable()
        {
            Dictionary <string, string> dict = new Dictionary <string, string>();

            try
            {
                cmd.ExecuteNonQuery();
                dict.Add("isRemove", "1");
            }
            catch (Exception ex)
            {
                DebugErrorHelper.WriteErrorLog(ex.Message);
                DebugErrorHelper.WriteErrorLog(ex.StackTrace);
                dict.Add("isRemove", "0");
            }
            return(dict);
        }
Esempio n. 3
0
        public DataTable GetDataTableBySP()
        {
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            try
            {
                da.Fill(dt);
                return(dt);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                DebugErrorHelper.WriteErrorLog(error);
                DebugErrorHelper.WriteErrorLog(ex.StackTrace);
            }
            return(null);
        }
Esempio n. 4
0
        public DataTable GetDataTableWithParam()
        {
            DataTable     dt = new DataTable();
            SqlDataReader dr;

            try
            {
                dr = cmd.ExecuteReader();
                dt.Load(dr);
                dr.Close();
                return(dt);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                DebugErrorHelper.WriteErrorLog(error);
                DebugErrorHelper.WriteErrorLog(ex.StackTrace);
            }
            return(null);
        }