MikeyLDS Posted August 31, 2004 Posted August 31, 2004 Hiya ... I'm kinda knew to building databases and VB.Net I'm working through a tutorial that shows how to connect to databases, etc When I use my own database I get an error after using the update method: "An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll" "Additional information: Update requires a valid UpdateCommand when passed DataRow collection with modified rows." also ... "'Customer Facing System.exe': Loaded 'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded." <<< not sure if that is relevant though. Any help on this subject would be greatly appreciated! Many thanks, Mikey Quote Thanks Guys ... Your help is much appreciated. Bye the way, I love to chat online via messenger and peeps seem to ask me alot my my handle as well. If you wanna then please add energizerbunny101@hotmail.com to your instant messenger.
amir100 Posted August 31, 2004 Posted August 31, 2004 Hiya ... I'm kinda knew to building databases and VB.Net I'm working through a tutorial that shows how to connect to databases, etc When I use my own database I get an error after using the update method: "An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll" "Additional information: Update requires a valid UpdateCommand when passed DataRow collection with modified rows." also ... "'Customer Facing System.exe': Loaded 'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded." <<< not sure if that is relevant though. Any help on this subject would be greatly appreciated! Many thanks, Mikey Greetings fellow newbies ... Questions: 1. Are you using the Wizard or are you doing it manually? 2. Can you show us the update statement? Or maybe some more relevant code? ~tryingToHelp Quote Amir Syafrudin
Moderators Robby Posted August 31, 2004 Moderators Posted August 31, 2004 Mikey, you most likey used the design-time to create your Update statement, go to where the generated code is (the update statement) and modify it to reflect your table structure. Quote Visit...Bassic Software
MikeyLDS Posted August 31, 2004 Author Posted August 31, 2004 Greetings fellow newbies ... Questions: 1. Are you using the Wizard or are you doing it manually? 2. Can you show us the update statement? Or maybe some more relevant code? ~tryingToHelp Hiya, I'm using the Data Adapter Configuration Wizard. Here is the statement: "SELECT [Employee Forename], [Employee Initial], [Employee No], [Employee Surname], [Employee Title], [user ID] FROM [security Access]" "User ID" is the primary key. When I click on Next it tells me that the UPDATE and DELETE statements couldn't be created. Many thanks for your help. Quote Thanks Guys ... Your help is much appreciated. Bye the way, I love to chat online via messenger and peeps seem to ask me alot my my handle as well. If you wanna then please add energizerbunny101@hotmail.com to your instant messenger.
amir100 Posted August 31, 2004 Posted August 31, 2004 References ... To Robby, Sorry if I'm being rude, but do you know any good references (free would be better :D) about creating UpdateStatement. I'm a bit confused when dealing with the parameter. Thank you. Quote Amir Syafrudin
laredo512 Posted September 1, 2004 Posted September 1, 2004 In design time, when you get such a message, its because the system did NOT generate any update or insert command because you do NOT have a primary key in your db Quote Laredo512 * using VS.NET Pro 2003 *
laredo512 Posted September 1, 2004 Posted September 1, 2004 Hiya, I'm using the Data Adapter Configuration Wizard. Here is the statement: "SELECT [Employee Forename], [Employee Initial], [Employee No], [Employee Surname], [Employee Title], [user ID] FROM [security Access]" "User ID" is the primary key. When I click on Next it tells me that the UPDATE and DELETE statements couldn't be created. Many thanks for your help. Assuming you are using the system's wizard, you have to make sure your primary keys ARE assigned in your database. Otherwise, the system will give you those warning. Then, if the all statements ARE generated without warnings, you can use them. Otherwise, you have to type them out manually using parameters. Quote Laredo512 * using VS.NET Pro 2003 *
amir100 Posted September 1, 2004 Posted September 1, 2004 Assuming you are using the system's wizard, you have to make sure your primary keys ARE assigned in your database. Otherwise, the system will give you those warning. Then, if the all statements ARE generated without warnings, you can use them. Otherwise, you have to type them out manually using parameters. Agreed on what laredo already said. Btw, it's out of the topic. I need to know the use of "optimistic concurrency" option when using the wizard. Anyone mind sharing the info? Thx. Quote Amir Syafrudin
MikeyLDS Posted September 1, 2004 Author Posted September 1, 2004 Assuming you are using the system's wizard, you have to make sure your primary keys ARE assigned in your database. Otherwise, the system will give you those warning. Then, if the all statements ARE generated without warnings, you can use them. Otherwise, you have to type them out manually using parameters. But the User ID field "is" assigned in the database. When I load MS Access it puts a key next to it and when I use the wizard it even shows it in bold. Any other suggestions? Quote Thanks Guys ... Your help is much appreciated. Bye the way, I love to chat online via messenger and peeps seem to ask me alot my my handle as well. If you wanna then please add energizerbunny101@hotmail.com to your instant messenger.
laredo512 Posted September 1, 2004 Posted September 1, 2004 But the User ID field "is" assigned in the database. When I load MS Access it puts a key next to it and when I use the wizard it even shows it in bold. Any other suggestions?Do you have relations in the database? If you do, chances are this is the cause of it too. You should consider looking into typing up your queries and updates Quote Laredo512 * using VS.NET Pro 2003 *
laredo512 Posted September 1, 2004 Posted September 1, 2004 Agreed on what laredo already said. Btw, it's out of the topic. I need to know the use of "optimistic concurrency" option when using the wizard. Anyone mind sharing the info? Thx. BTW, Mikey started this thread. I beleive the topic is his. Quote Laredo512 * using VS.NET Pro 2003 *
laredo512 Posted September 1, 2004 Posted September 1, 2004 To Robby, Sorry if I'm being rude, but do you know any good references (free would be better :D) about creating UpdateStatement. I'm a bit confused when dealing with the parameter. Thank you.Lookup the user Joe Mamma and the word parameters in this forum. :) Quote Laredo512 * using VS.NET Pro 2003 *
MikeyLDS Posted September 2, 2004 Author Posted September 2, 2004 BTW' date=' Mikey started this thread. I beleive the topic is his.[/quote'] LOL, ta! ;-P Quote Thanks Guys ... Your help is much appreciated. Bye the way, I love to chat online via messenger and peeps seem to ask me alot my my handle as well. If you wanna then please add energizerbunny101@hotmail.com to your instant messenger.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.