Exemple #1
0
        public void UpdateRow(string sql)
        {
            string        constr = ConfigurationManager.ConnectionStrings["MVIntConnectionString"].ConnectionString;
            SqlConnection cn     = new SqlConnection(constr);

            cn.Open();
            SqlCommand cmd = new SqlCommand(sql, cn);

            try
            {
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataSet        ds = new DataSet();
                da.Fill(ds);
                //  tran.Commit();
                MessageBox.Show("Updated successfully");
                clerALL();
                BTSForADJ bts = new BTSForADJ();
                bts.loadgrid();
                this.Close();
            }

            catch (Exception exp)
            {
                string error = exp.Message.ToString();
                // tran.Rollback();
                MessageBox.Show("Failed to Update. Please check the data");
            }
            //  loadgrid();
            cn.Close();
        }
        private void linkLabel36_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            BTSForADJ btsAdj = new BTSForADJ();

            btsAdj.Show();
        }