dbTalk Databases Forums  

cant'update a database with update

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss cant'update a database with update in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TonyJ
 
Posts: n/a

Default 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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.