Last post May 05, 2009 04:44 PM by NvrBst
May 04, 2009 09:02 PM|NvrBst|LINK
When I add a DataSet to my WebPage and drop my table onto the page it only autogenerates the SELECT / INSERT commands. I believe this may be because the TABLE doesn't have a Primary Key. I right click a column and hit "Set as Primary Key" and then try
Right click the TableAdapter > Configure. Advance > Generate Update / etc. Next. Create methods to send updates directly... (check). END.
The End Summy doesn't state "Generate UPDATE Command", and when I hid Finish the Update command doesn't get generated. Some tables in the same database (which do have primary keys) get all 3 (UPDATE/SELECT/INSERT) commands all auto-generated, but a few
(which do have primary keys by default) only get the (INSERT/UPDATE) as well. So maybe it's not a problem with the primary key?
Would anyone know what might be the problem? Do I have to create the UPDATE command manually? Am I doing something wrong with refreshing the Update Command after manually setting the Primary Key? What are the requirments for the UPDATE command to be auto-gernated?
Note: The Select/Insert commands both works fine.
Thanks, If any additional information is needed just tell me where to find it and I'll attempt to post.
May 05, 2009 04:44 PM|NvrBst|LINK
Ahh silly me. Simply Right-Clicking on the TableAdapter and choosing "Add Query...". Selecting "SELECT Query" and choosing "Update" auto fills the command with the basic "autogenerated" information (even without the Primary Key). I didn't try choosing
the new method as "Update" and seeing it it'd overload the exsisting (none working) one, however, just using something like "MyUpdate" or "UpdateByAll" works fine.