Home All Groups Group Topic Archive Search About

DbProvider GetFactory exception with system.data.sqlclient

Author
14 Mar 2006 12:51 AM
lk
I received an exception when I tried to use provider name
"system.data.sqlclient" to create a db factory.

DbProviderFactory dbFactory =
DbProviderFactories.GetFactory("system.data.sqlclient");

The exception message is:-
"Unable to find the requested .Net Framework Data Provider.  It may not be
installed."

I have SQL Server 2005 and Visual Studio 2005 installed on my system.
Can someone tell me what did I do wrong or miss?

Thanks

--
LK

Author
14 Mar 2006 5:53 AM
Cor Ligthert [MVP]
LK,

I was not able to do it using that overloaded version with the string.
Should go however I could not find documentation. In the way as it is done
in this sample on our website it works.

http://www.vb-tips.com/default.aspx?ID=8c3dc2d7-1232-4dd1-817e-22eaaebb2723

I hope this helps,

Cor

Show quote
"lk" <l*@discussions.microsoft.com> schreef in bericht
news:98F4881E-D482-49B9-825C-DE1F7D86E041@microsoft.com...
>I received an exception when I tried to use provider name
> "system.data.sqlclient" to create a db factory.
>
> DbProviderFactory dbFactory =
> DbProviderFactories.GetFactory("system.data.sqlclient");
>
> The exception message is:-
> "Unable to find the requested .Net Framework Data Provider.  It may not be
> installed."
>
> I have SQL Server 2005 and Visual Studio 2005 installed on my system.
> Can someone tell me what did I do wrong or miss?
>
> Thanks
>
> --
> LK
Author
14 Mar 2006 2:00 PM
W.G. Ryan - MVP
use "System.Data.SqlClient" instead of the lower cased spelling. It' case
sensitive.  Change the casing and you should be fine. If not let me know.

Bill
Show quote
"lk" <l*@discussions.microsoft.com> wrote in message
news:98F4881E-D482-49B9-825C-DE1F7D86E041@microsoft.com...
>I received an exception when I tried to use provider name
> "system.data.sqlclient" to create a db factory.
>
> DbProviderFactory dbFactory =
> DbProviderFactories.GetFactory("system.data.sqlclient");
>
> The exception message is:-
> "Unable to find the requested .Net Framework Data Provider.  It may not be
> installed."
>
> I have SQL Server 2005 and Visual Studio 2005 installed on my system.
> Can someone tell me what did I do wrong or miss?
>
> Thanks
>
> --
> LK

AddThis Social Bookmark Button