> The DeriveParameters method is specify for providers. If you don't know
> the
> provider, it's hard to call DeriveParameters method. You can try to cast
> the object into desired type and then call DeriveParameter method. There
> is
> no elegant way in this case, AFAIK.
I can't cast it if I don't know what it is. I did find a workaround though,
using reflection:
DbCommand command = DbFactory.CreateCommand();
// [Snip] code to and assign values to command
Type commandBuilderType = DbFactory.CreateCommandBuilder().GetType();
MethodInfo deriveParametersMethodInfo =
commandBuilderType.GetMethod("DeriveParameters");
if(deriveParametersMethodInfo != null){
object[] deriveParametersMethodArgs = { command };
deriveParametersMethodInfo.Invoke(null, deriveParametersMethodArgs);
}
--
-James
Blog:
http://blogs.remobjects.com/blogs/jimmy/
Furl:
http://www.furl.net/members/jimmytharpe