command builder

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

I am using a command builder an need to modify some of the statements it
generates. I can use
MySqlCmdBuilder.GetInsertCommand.CommandText.ToString to obtain the
insert command it generates then .replace() to "fix" the problem but
after modifying them how do I get commandbuilder to take them back?
 
Hi,

Thanks for your post.

Yes, this behavior is by design. For SqlCommandBuilder, we can not modify
the generated text to customized one. Because this is more an ADO.net issue
than VB.net issue, I suggest you paste such issue in
microsoft.public.dotnet.framework.adonet newsgroup. Then you will more
professional help there.

Thanks

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.
 
CJ,

In my opinion is what you ask impossible (AFAIK builds the commandbuilder
just in time based on the columns in the datatable and watches which columns
have changes in that)

However why than not just use the dataadapterwizard (to generate the right
commands for you (version Net 1.x))

You can than cut the commands from the designer parts, delete the
dataadapter again and use those generated commands that you have paste in
your routine again.

Just a thought,

Cor
 
cj,

In version 2.0 you can get the commandtexts from the strongly typed dataset,
however it is a little bit more work.

Cor
 
How from within my code can I get a dataadapter to build the insert
command? That sound like a good option but I can't do it at design
time--it will have to be done in code at runtime.
 
I'm sorry I don't understand what your saying. I am still interested in
knowing how to use the data adapter wizard in code. However I've
already found a way to dynamically create the command I need. I'm
submitting a new question for a problem I'm having with that now.
 
Back
Top