me_again
Member
Heres a question for the gurus out there.
Ive got a DataSet bound to a DataGrid conrol. I used Robbys example code (http://www.computerhelp.forum/showthread.php?s=&threadid=71636), and built my own Insert, Update and Delete commands. These work fine when I make changes to the data in the grid, ie. they insert, update & delete fine.
My question is this: Why does the Update, Insert and Delete commands generated by the SQLCommandBuilder not work?
I notice that when Robby set up the parameters for each command, he names the parameters using the fieldname, with the @ appended to the fieldname.
The SQLCommandBuilder, on the other hand, generates parameter names of the form @p1, @p2, @p3 etc.
Other than that, there seems to be no major diffirence between the two commands.
I read up on the SQLCommandBuilder, and I understand that it wont generate commands where more than ONE table is referenced in the SELECT statement, and thats fine, because Im using the most commonest of common SQL statements SELECT * FROM TableName. But not even the Update etc. commands generated by the SQLCommandBuilder for this simple statement works.
If it doenst even work for a statement as simple as the above, why on earth would anybody want to use it?
ADO might have been more complicated, but at least it worked.
Cheers
Ive got a DataSet bound to a DataGrid conrol. I used Robbys example code (http://www.computerhelp.forum/showthread.php?s=&threadid=71636), and built my own Insert, Update and Delete commands. These work fine when I make changes to the data in the grid, ie. they insert, update & delete fine.
My question is this: Why does the Update, Insert and Delete commands generated by the SQLCommandBuilder not work?
I notice that when Robby set up the parameters for each command, he names the parameters using the fieldname, with the @ appended to the fieldname.
The SQLCommandBuilder, on the other hand, generates parameter names of the form @p1, @p2, @p3 etc.
Other than that, there seems to be no major diffirence between the two commands.
I read up on the SQLCommandBuilder, and I understand that it wont generate commands where more than ONE table is referenced in the SELECT statement, and thats fine, because Im using the most commonest of common SQL statements SELECT * FROM TableName. But not even the Update etc. commands generated by the SQLCommandBuilder for this simple statement works.
If it doenst even work for a statement as simple as the above, why on earth would anybody want to use it?
ADO might have been more complicated, but at least it worked.
Cheers