Click here to Skip to main content
15,893,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all...
C#
private void button1_Click(object sender, EventArgs e)
{
  bindingSource1.EndEdit();
  int result = 0;
  customerTableAdapter1.Update(mycompanyDataSet1.Customer);
  MessageBox.Show(result.ToString());
}

When i compile above code i am getting this error..
MSIL
Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
Posted
Updated 20-Apr-11 7:45am
v3
Comments
BobJanova 20-Apr-11 11:12am    
The error message rather tells you what the problem is ... pass a valid UpdateCommand.

Before
bindingSource1.EndEdit();

u forgot { i guess
 
Share this answer
 
Without more code, it's hard to say what might be wrong.

Here's a related thread from the MSDN forums:

http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/666835a2-50ec-415f-ba30-bb80ca51c91b[^]
 
Share this answer
 
Make sure the table has a primary key and that you are not trying to update a view.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900