Hi Ilan,
How do you create the Update command for your DataAdapter? If you aren't
doing so, try using a CommandBuilder to create the insert, delete and
update commands.
using (SqlDataAdapter da = new SqlDataAdapter(insertCommand))
{
// command builder will add insert, update and delete
using (SqlCommandBuilder sb = new SqlCommandBuilder(da))
{
da.Fill(ds);
}
}
On Mon, 30 Oct 2006 11:26:01 +0100, Ilanco
<Il****@discussions.microsoft.comwrote:
I'm new to c#.
I am trying to insert or update data to my tables, and in the debug mode
everithig looks ok. when i exit and look in the database all the update
or
insert did not take effect. i'm using Visual c# 2005 express and SQl 2005
express.
I tried to insert a button with this code :
private void Update_button_Click(object sender, EventArgs e)
{
dutyTBBindingSource.EndEdit();
dutyTBTableAdapter.Update(plugaDBDataSet.DutyTB);
}
thanks
Ilan
--
Happy Coding!
Morten Wennevik [C# MVP]