PC Review


Reply
Thread Tools Rate Thread

displaying the sql commands generated by commandbuilder?

 
 
cj
Guest
Posts: n/a
 
      19th Dec 2005

I'm using the commandbuilder to generate insert commands for some tables
for me. I provided it the select command "select * from mytable". I've
used this on several tables and it was building the appropriate insert
command correctly. Then I hit a table where it gave me the error:
"Update error: Incorrect syntax near the keyword 'desc'."

I have a good idea what is going wrong as there is a field in this table
named desc but there is no need for the keyword desc in the insert
command. I'd like to see exactly what it is trying to use as an insert
command. I tried setting a breakpoint and then in the command window
typing "? mysqladapter.insetcommand.commandtext" but it comes back with
a value of 'Nothing' How can I see what the insert command is?
Preferably in code so I might modify it at runtime to correct the problem.
 
Reply With Quote
 
 
 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      20th Dec 2005
Hi,

Thanks for your post.

Yes, Command Builder is just a listener on the updating operation, we can
use SqlCommandBuilder.GetInsertCommand().CommandText to get the generated
insert command text.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commands and CommandBuilder Pashkuale Microsoft ADO .NET 4 13th Oct 2005 08:41 AM
commandbuilder generated sql commands =?Utf-8?B?TmVkaW0=?= Microsoft ADO .NET 2 15th Sep 2004 07:34 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ASP .NET 1 12th Dec 2003 04:46 PM
Inserting identity columns with CommandBuilder generated commands? Carl Mercier Microsoft ADO .NET 9 23rd Nov 2003 11:46 PM
CommandBuilder commands Konrad Microsoft ADO .NET 4 18th Sep 2003 05:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 PM.