Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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.

Posted
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

Amir Syafrudin
  • Moderators
Posted
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.
Visit...Bassic Software
Posted
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.

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.

Posted

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.

Amir Syafrudin
Posted
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

Laredo512

* using VS.NET Pro 2003 *

Posted
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.

Laredo512

* using VS.NET Pro 2003 *

Posted
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.

Amir Syafrudin
Posted
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?

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.

Posted
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

Laredo512

* using VS.NET Pro 2003 *

Posted
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.

Laredo512

* using VS.NET Pro 2003 *

Posted
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. :)

Laredo512

* using VS.NET Pro 2003 *

Posted
BTW' date=' Mikey started this thread. I beleive the topic is his.[/quote']

 

LOL, ta! ;-P

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...