PC Review


Reply
Thread Tools Rate Thread

DbCommandBuilder.DeriveParameters

 
 
Ale
Guest
Posts: n/a
 
      3rd Jul 2009
Well the Provider-Independent Data Access is quite good in ADO .NET 2.0

My only problem with it and what makes it somehow useless is that
DbCommandBuilder does not have an implementation for DeriveParameters... Now
My code goes:

-------------

DbProviderFactory DbProvider =
DbProviderFactories.GetFactory("System.Data.SqlClient");

DbConnection dbConnectionObj = DbProvider.CreateConnection();

dbConnectionObj.ConnectionString = ConnectionString;

DbCommand dbCommandObj = DbProvider.CreateCommand();

dbCommandObj.Connection = dbConnectionObj;

dbCommandObj.CommandText = storedProcedureName;

dbCommandObj.CommandType = CommandType.StoredProcedure;

dbCommandObj.Connection.Open();

------------

Now I would like to add

DbCommandBuilder.DeriveParameters(dbCommandObj);

but the DbCommandBuilder does not have an implementation for
DeriveParameters

How can this be done? Is there something I'm missing?


 
Reply With Quote
 
 
 
 
Miha Markic
Guest
Posts: n/a
 
      6th Jul 2009
Right now I am not sure why the DeriveParameters method is static but you
might try using reflection to get to it, something like this:
MethodInfo mi = cb.GetType().GetMethod("DeriveParameters",
BindingFlags.Public | BindingFlags.Static);
mi.Invoke(null, new object[] { dbCommandObj});

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: blog.rthand.com

"Ale" <(E-Mail Removed)> wrote in message
news:4a4e1566$0$712$(E-Mail Removed)...
> Well the Provider-Independent Data Access is quite good in ADO .NET 2.0
>
> My only problem with it and what makes it somehow useless is that
> DbCommandBuilder does not have an implementation for DeriveParameters...
> Now My code goes:
>
> -------------
>
> DbProviderFactory DbProvider =
> DbProviderFactories.GetFactory("System.Data.SqlClient");
>
> DbConnection dbConnectionObj = DbProvider.CreateConnection();
>
> dbConnectionObj.ConnectionString = ConnectionString;
>
> DbCommand dbCommandObj = DbProvider.CreateCommand();
>
> dbCommandObj.Connection = dbConnectionObj;
>
> dbCommandObj.CommandText = storedProcedureName;
>
> dbCommandObj.CommandType = CommandType.StoredProcedure;
>
> dbCommandObj.Connection.Open();
>
> ------------
>
> Now I would like to add
>
> DbCommandBuilder.DeriveParameters(dbCommandObj);
>
> but the DbCommandBuilder does not have an implementation for
> DeriveParameters
>
> How can this be done? Is there something I'm missing?
>
>

 
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
DbCommandBuilder issues Philippe Bertrand Microsoft ADO .NET 2 7th Dec 2006 04:58 AM
DbCommandBuilder updating read-only columns Philippe Bertrand Microsoft ADO .NET 0 6th Dec 2006 04:04 PM
DeriveParameters =?Utf-8?B?Q2h1Y2sgUA==?= Microsoft ADO .NET 9 21st Nov 2006 05:09 AM
Why is DbCommandBuilder generating DEFAULT VALUES on the end of some INSERT statements? Reggie Burnett Microsoft ADO .NET 2 26th Jul 2006 06:26 PM
Are there any DbCommandBuilder implementation examples? =?Utf-8?B?SmltIEhhcnR6ZWxs?= Microsoft ADO .NET 2 9th Feb 2006 07:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:02 AM.