2 Attachment(s)
[RESOLVED] Please Help Update Command
Please help... I have done everything required to afaik to enable the update.
I have used stronly typed components from the Form1, I have the ListBox and the TextBoxes set to appropriate Bindings. The ListBox dataSourse is set to BindingsSource1 and the textBoxes are set to the appropriate bindingsource fields which are FirstName and LastName.
In the BtnClick Event I have
Code:
BindingSource1.EndEdit()
CustomerTableAdapter1.Update(CustomerDataSet1.Customer)
This should NOT be giving me an UpDate Command Error.
I have wasted an hour or more but can't see what I have done to cause this!!!!
Clicking on a name in the listbox updates the TextBoxes through the BindingsSource1 Control. Everything is functional untill I change a textbox and try to Update.
Help.
Re: Please Help Update Command
That means the the Data Source wizard hasn't generated an UPDATE statement when it created the TableAdapter. That will happen if you tell it not to, if the query joins multiple tables or if the query doesn't return a primary key.
Does your database table have a primary key? Does your TableAdapter's query return that primary key?