I have a database and I figured out how to store data but i can't edit anything. This is a part of my code: private void button1_Click(object sender, EventArgs e) { MyDataSet.MyTable.AddMyTableRow(textBox1.Text,textBox2.Text,textBox3.Text,textBox4.Text,textBox5.Text); MyTableAdapter.Update(MyDataSet.MyTable); toolStripProgressBar1.PerformStep(); MessageBox.Show("Update Complete", "Update Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.Close(); } private void button5_Click(object sender, EventArgs e) { DataTable dtedit = MyDataSet.MyTable; DataRow dr11 = dtedit.NewRow(); dr11["Field1"] = textBox6.Text; dr11["Field2"] = textBox7.Text; dr11["Field3"] = textBox8.Text; dr11["Field4"] = textBox10.Text; dr11["Field5"] = textBox11.Text; dr11.AcceptChanges(); MyTableAdapter.Update(MyDataSet.MyTable); }
E
eni_94
@eni_94
Posts
-
How can I edit a database row and then update it ? -
Can anyone help me ?that worked but when i open the program i add an item, if i restart the program the new item isn't there anymore...
-
Can anyone help me ?thanx a lot
-
Can anyone help me ?thanx a lot ,it works
-
Can anyone help me ?I wanna know how to add an item to a combobox from a textbox by clicking a button. I usually use C# so i'd prefer to finish what i'm doing in C#. thanx.