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?
>
>