PC Review


Reply
Thread Tools Rate Thread

Command builder question

 
 
John
Guest
Posts: n/a
 
      14th Mar 2010
Hi

I am using below code to automatically generate commands via command
builder.

QuerySt = "SELECT <fiedl list> FROM ..."
CompanyAdapter = New OleDbDataAdapter(QuerySt, LocalConn)
CompanyBuilder = New OleDbCommandBuilder(CompanyAdapter)
CompanyAdapter.Fill(CompanyTable)

Is there a way to take command builder generated INSERT/UPDATE/DELETE
commands, modify them and get data adapter to use the modified command
instead of the command builder generated commands?

Thanks

Regards


 
Reply With Quote
 
 
 
 
Reece Laurie
Guest
Posts: n/a
 
      23rd Mar 2010
Hi,

The OleDbCommandBuilder has GetInsertCommand(), GetUpdateCommand(), and
GetDeleteCommand() which each returns an OleDbCommand object. You can then
modify the command object as needed and explicitly set it to the appropriate
OleDbDataAdapter property (OleDbDataAdapter.InsertCommand,
OleDbDataAdapter.UpdateCommand, or OleDbDataAdapter.DeleteCommand).

http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
-- second paragraph of the Remarks section notes doing this type of
action...




"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I am using below code to automatically generate commands via command
> builder.
>
> QuerySt = "SELECT <fiedl list> FROM ..."
> CompanyAdapter = New OleDbDataAdapter(QuerySt, LocalConn)
> CompanyBuilder = New OleDbCommandBuilder(CompanyAdapter)
> CompanyAdapter.Fill(CompanyTable)
>
> Is there a way to take command builder generated INSERT/UPDATE/DELETE
> commands, modify them and get data adapter to use the modified command
> instead of the command builder generated commands?
>
> Thanks
>
> Regards
>
>



 
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
command builder cj Microsoft VB .NET 6 20th Dec 2005 07:59 PM
Re: DeriveParameters(cm) - SQL Command Builder William \(Bill\) Vaughn Microsoft ADO .NET 0 17th Jun 2004 09:54 PM
newbie command builder question Marina Microsoft ASP .NET 1 24th Mar 2004 06:19 AM
Command Builder vaishali Microsoft ADO .NET 1 9th Aug 2003 03:48 PM
transaction and command builder VR Microsoft ADO .NET 4 23rd Jul 2003 08:49 AM


Features
 

Advertising
 

Newsgroups
 


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