I am working through a text book on VB.net VS 2010 and have found a problem I can't explain.
I have created a datasource via Data->Add Data Source and selected a table to appear in a dataset.
The datasource is SQL server 2008.
I can see the tables in the Visual Studio Data Sources window and I have dragged it on to a single windows form.
Visual Studio generates a datagrid for me automatically complete with navigation buttons to delete,
add and save changes made to the dataset.
When I run the program it reads the source data into the grid and I can add new rows to it and click the save button
to save the new rows.
However if I try deleting a row or changing a cell in an existing row, the program throws a runtime error on the
Me.MyTableTableAdapter.Fill(Me.MyDataSource.MyTable) command indicating the Update and Delete commands are not set.
So it seems the auto generated code is not created for an Update or Delete on a datagrid.
The text book I am following gives the impression the add, delete and update options should all work from auto-generated code.
I have also tried the same thing on an Iseries/AS400 dataset and get the same behaviour.
Is is always the case the data adapter update and delete code is not generated this always the case or is there something I need to do?
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.
I have created a datasource via Data->Add Data Source and selected a table to appear in a dataset.
The datasource is SQL server 2008.
I can see the tables in the Visual Studio Data Sources window and I have dragged it on to a single windows form.
Visual Studio generates a datagrid for me automatically complete with navigation buttons to delete,
add and save changes made to the dataset.
When I run the program it reads the source data into the grid and I can add new rows to it and click the save button
to save the new rows.
However if I try deleting a row or changing a cell in an existing row, the program throws a runtime error on the
Me.MyTableTableAdapter.Fill(Me.MyDataSource.MyTable) command indicating the Update and Delete commands are not set.
So it seems the auto generated code is not created for an Update or Delete on a datagrid.
The text book I am following gives the impression the add, delete and update options should all work from auto-generated code.
I have also tried the same thing on an Iseries/AS400 dataset and get the same behaviour.
Is is always the case the data adapter update and delete code is not generated this always the case or is there something I need to do?
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.