update
-
Hi, In my form one datagridview control is there,insert button When we click on insert a new row is added to the datagidview.If we enter values in that new row and click on save button ,the newly inserted row is updated to database.To get this what code i have to write in save button click. Please help me. Thanks in advance
-
Hi, In my form one datagridview control is there,insert button When we click on insert a new row is added to the datagidview.If we enter values in that new row and click on save button ,the newly inserted row is updated to database.To get this what code i have to write in save button click. Please help me. Thanks in advance
first you must set the gridview DataSource: dataGridView1.DataSource =DS.tables["x"]; then u must add row to the DataTable for exmaple : a = a+1; b = textBox1.Text; dt.Rows.Add(new object[] { a, b}); after click the button to update data in database: scb = new SqlCommandBuilder(DA); DA.Update(DS, "tbhazine");
-
first you must set the gridview DataSource: dataGridView1.DataSource =DS.tables["x"]; then u must add row to the DataTable for exmaple : a = a+1; b = textBox1.Text; dt.Rows.Add(new object[] { a, b}); after click the button to update data in database: scb = new SqlCommandBuilder(DA); DA.Update(DS, "tbhazine");