Expand|Select|Wrap|Line Numbers
- private void button2_Click(object sender, EventArgs e)
- {
- String str1 = "select * from table1";
- dad1 = new SqlDataAdapter(str1, con);
- dad1.Fill(ds,"table1");
- SqlCommandBuilder cmdbuild = new SqlCommandBuilder(dad1);
- DataRow drow2 = ds.Tables["table1"].NewRow();
- drow2[1] = "chop";
- drow2[2] = 10;
- ds.Tables["table1"].Rows.Add(drow2);
- dad1.Update(ds,"table1");
- MessageBox.Show("done");
- }
PS: i checked the dataset designer for my table and it had an sql query Fill,Getdata(), so i added another called insertquery() but then i am not able to figure out how to access this query from the form!!!