Home All Groups Group Topic Archive Search About

DbProviderFactory, System.Data.Common, huh?

Author
20 Feb 2007 3:43 AM
Jeff Jarrell
I finally stumbled across the DbProviderFactory in System.Data.Common.  I
had a similar factory in my framework but I thought it would be better to
use the framework code, so of I went to change the code.

As I was doing this it is apparent that when using the DbProvider (both the
base and the derived types), they do not have any of the additional method
signatures on the Create???.

DbProviderFactory.CreateParameter(). First thing you need to do is to at
least assign a name, then perhaps a type.  In the MSSQL client there are
seven signatures.  Some of which are essential for working with datasets and
adapters.

So correct me if I am wrong, but I need to write a wrapper\helper\factory
method of encapsulate DbProviderFactory to provide some of the additional
signatures. Seems like the idea is a little half-baked.  Aargh...

Thanks,
jeff

Author
14 Mar 2007 5:11 PM
Mary Chipman [MSFT]
Your assessment of the usefulness of the DbProviderFactory when it
comes to handling parameters is correct. Here's a link to the
documentation on handling parameters
http://msdn2.microsoft.com/en-us/library/9hy8csk1.aspx. The parent
(misnamed) topic is located at
http://msdn2.microsoft.com/en-us/library/t9f29wbk.aspx. For this
version of ADO.NET you're better off sticking with your own factory.
--Mary

On Mon, 19 Feb 2007 22:43:29 -0500, "Jeff Jarrell"
<jjarrel_NOSPAM@yahoo.com> wrote:

Show quote
>I finally stumbled across the DbProviderFactory in System.Data.Common.  I
>had a similar factory in my framework but I thought it would be better to
>use the framework code, so of I went to change the code.
>
>As I was doing this it is apparent that when using the DbProvider (both the
>base and the derived types), they do not have any of the additional method
>signatures on the Create???.
>
>DbProviderFactory.CreateParameter(). First thing you need to do is to at
>least assign a name, then perhaps a type.  In the MSSQL client there are
>seven signatures.  Some of which are essential for working with datasets and
>adapters.
>
>So correct me if I am wrong, but I need to write a wrapper\helper\factory
>method of encapsulate DbProviderFactory to provide some of the additional
>signatures. Seems like the idea is a little half-baked.  Aargh...
>
>Thanks,
>jeff
>

AddThis Social Bookmark Button