473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

displaying the sql commands generated by commandbuilder?

cj

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.
Dec 19 '05 #1
1 1201
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.

Dec 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
10
by: Joao Santa Barbara | last post by:
hi all i need to work with the commandbuilder and with a transaction object how can i do this ???? thks JSB please don´t tell me that i have to do this ex:
1
by: Marina | last post by:
The commands that are generated by the SqlCommandBuilder are not quite right. I am calling GetUpdateCommand and GetDeleteCommand, modifying the results, and assigning them to the UpdateCommand and...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
3
by: Ed | last post by:
I just learned how to use the Commandbuilder and have researched it a little bit further and see that there is a dispose property. Should this be used after invoking the command builder or does...
3
by: RJN | last post by:
Hi I'm using the Dataadapter and Dataset to do an insert/update/delete into tables. The dataset has multiple tables in it. I want to write my own Update/Insert commands for the Dataadapter for...
10
by: cj | last post by:
I have lots of tables to copy from one server to another. The new tables have been created to match the old ones. I practiced with one table. I created the select command (select * from tableA)...
3
by: John Cosmas | last post by:
I have a DATATABLE which I have populated in my application, and I need it written out to a particular table I specify in my ACCESS database. My code works to the point of the MERGE and UPDATE,...
1
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I read this article: http://msdn2.microsoft.com/en-us/library/tf579hcz.aspx The example in the article is using the SqlCommandBuilder. Is it possible to generate commands automatically using...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.