Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            ClsDB db = new ClsDB();

            try
            {
                db.Connect();
                db.GetDataTable_Proc("Prc_User");
                MessageBox.Show("Saved");
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); Log.Error(ex, "Error Occured"); }
            finally
            {
                db.DisConnect();
                db = null;
            }
        }
Example #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            ClsDB db = new ClsDB();

            try
            {
                db.Connect();
                Dictionary <string, string> DicProcParameter = new Dictionary <string, string>();
                DicProcParameter.Add("@Id", txtId.Text);
                DicProcParameter.Add("@Name", txtName.Text);

                db.GetDataTable_Proc("Prc_User", DicProcParameter);
                MessageBox.Show("Saved");
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); Log.Error(ex, "Error Occured"); }
            finally
            {
                db.DisConnect();
                db = null;
            }
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            ClsDB db = new ClsDB();

            try
            {
                db.Connect();
                SqlParameter[] parameters =
                {
                    new SqlParameter("@Id",   txtId.Text),
                    new SqlParameter("@Name", txtName.Text)
                };
                db.GetDataTable_Proc("Prc_User", parameters);
                MessageBox.Show("Saved");
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); Log.Error(ex, "Error Occured"); }
            finally
            {
                db.DisConnect();
                db = null;
            }
        }