PC Review


Reply
Thread Tools Rate Thread

CommandBuilder commands

 
 
Konrad
Guest
Posts: n/a
 
      17th Sep 2003
Hi

How or where can I see full used commands generated
via CommandBuilder for DataAdapter.
Using DataAdapter not CommandBuilder?

Thanks
Konrad


 
Reply With Quote
 
 
 
 
David Browne
Guest
Posts: n/a
 
      17th Sep 2003

"Konrad" <(E-Mail Removed)> wrote in message
news:bka88v$4k8$(E-Mail Removed)...
> Hi
>
> How or where can I see full used commands generated
> via CommandBuilder for DataAdapter.
> Using DataAdapter not CommandBuilder?
>


If the DataAdapter needs a command that it doesn't have, it will invoke the
CommandBuilder to create one.

If you need to see the command ( and perhaps modify it ) before the
DataAdapter uses it, you can invoke the CommandBuilder yourself.

Just use CommandBuilder.GetXXXCommand, optionally edit the command, and pass
the command to the DataAdapter.

eg


dim cb as new SqlCommandBuilder(da)
.. ..
Dim cmd As SqlCommand = cb.GetInsertCommand
cmd.CommandText = cmd.CommandText & "; set @newid = SCOPE_IDENTITY()"
Dim pNewID As SqlParameter = New SqlParameter("@newid", SqlDbType.Int)
pNewID.Direction = ParameterDirection.Output
pNewID.SourceColumn = "ID"

to return the new ID column into the dataset.


 
Reply With Quote
 
William Ryan
Guest
Posts: n/a
 
      17th Sep 2003
Debug.WriteLine(myCommandBuilder.GetDeleteCommand())

....GetSelectCommand()
....GetUpdateCommand()

If you use the DataAdapter Configuration wizard, look for its Select,
Update, Delete COmmands respectively....they will be in the form that you
dragged the adapter onto.

HTH,

Bill
"Konrad" <(E-Mail Removed)> wrote in message
news:bka88v$4k8$(E-Mail Removed)...
> Hi
>
> How or where can I see full used commands generated
> via CommandBuilder for DataAdapter.
> Using DataAdapter not CommandBuilder?
>
> Thanks
> Konrad
>
>



 
Reply With Quote
 
Steven Bras [MS]
Guest
Posts: n/a
 
      17th Sep 2003
Great answers, guys! Thanks for posting.

Steven Bras, MCSD
Microsoft Developer Support/Data Access Technologies

This posting is provided "AS IS" with no warranties, and confers no rights.

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-026?* If not Microsoft strongly advises you to
review the information at the following link regarding Microsoft Security
Bulletin MS03-026
http://www.microsoft.com/security/se...s/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026.

 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      18th Sep 2003
Take a look at my article on using (or not using) the CommandBuilder. See
http://www.betav.com/msdn_magazine.htm

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Konrad" <(E-Mail Removed)> wrote in message
news:bka88v$4k8$(E-Mail Removed)...
> Hi
>
> How or where can I see full used commands generated
> via CommandBuilder for DataAdapter.
> Using DataAdapter not CommandBuilder?
>
> Thanks
> Konrad
>
>



 
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
displaying the sql commands generated by commandbuilder? cj Microsoft VB .NET 1 20th Dec 2005 07:29 AM
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 ADO .NET 1 12th Dec 2003 05:58 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ASP .NET 1 12th Dec 2003 04:46 PM


Features
 

Advertising
 

Newsgroups
 


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