cant'update a database with update -
06-29-2007
, 08:02 AM
Hello!
I try to update a database. I have a datagridview that has thrree columns
and two rows from beginning.
When I make changes in the datagrid these are only stored locally in the
dataset and not in the database
because if I make some changes and the close the application and then start
up again the
old values are shown. I can also see that no changes has been made if I look
in the database table.
Have anybody any answer why the changes are not stored in the database?
Below is some code from my application
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the
'minDatabasDataSet1.Kunder' table. You can move, or remove it, as needed.
this.kunderTableAdapter.Fill(this.minDatabasDataSe t1.Kunder);
int count;
count = minDatabasDataSet1.Tables[0].Rows.Count;
//DataTable dt = this.minDatabasDataSet1.Tables[0];
//DataRow dr = dt.Rows[0];
//dr["KundNr"] = (int)dr["KundNr"] + 99;
this.kunderTableAdapter.Update(this.minDatabasData Set1);
}
private void buttonUpdate_Click(object sender, EventArgs e)
{
//this.kunderTableAdapter.Fill(this.minDatabasDataSe t1.Kunder);
//DataTable dt = this.minDatabasDataSet1.Tables[0];
//DataRow dr = dt.Rows[0];
this.kunderTableAdapter.Update(this.minDatabasData Set1);
}
//Tony |