View Single Post
Join Date: Sep 2008
Posts: 6
Reputation: markyjj is an unknown quantity at this point 
Solved Threads: 0
markyjj markyjj is offline Offline
Newbie Poster

Re: Updating SQL database, Please help

 
0
  #5
Sep 8th, 2008
Originally Posted by gusano79 View Post
Looks like you're not generating the update command. It isn't actually created until you call SqlCommandBuilder.GetUpdateCommand(). You'll need something like this:

  1. MovAdapt.UpdateCommand = cb.GetUpdateCommand

This article has a good explanation of how it works.
I have tried using the following code: MovAdapt.UpdateCommand = cb.GetUpdateCommand but now I get the following exception:

An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll

Additional information: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.


Thanks for any further help.
Reply With Quote