Home All Groups Group Topic Archive Search About

DbProviderFactory & creating from DbProviderFactories.GetFactoryCl

Author
9 Mar 2006 9:23 PM
David Thielen
Hi;

When I call
DbProviderFactories.GetFactory("System.Data.SqlClient").CreateDataSourceEnumerator().GetDataSources();

I get 2 entries for my computer (Sql Server & Sql Server Express). For Sql
Server I get "BELLE", DBNull, "No", "8.00.194" and for Sql Server Express I
get "BELLE", "SQLEXPRESS", "No", "9.00.1399.06".

My question is, how do I build a connection string to the server based on
this info returned?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Author
10 Mar 2006 3:07 AM
Kevin Yu [MSFT]
Hi Dave,

The first string is the server name, the second string is the instance
name. If the second one is DBNull, it means that the instance is the
default one on that server. So, for the first entry, you can use BELLE as
the datasource in the connection string. And for the second one, you can
use BELLE\SQLEXPRESS as the datasource. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
10 Mar 2006 4:18 AM
David Thielen
that's it - thanks
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com



Show quote
"Kevin Yu [MSFT]" wrote:

> Hi Dave,
>
> The first string is the server name, the second string is the instance
> name. If the second one is DBNull, it means that the instance is the
> default one on that server. So, for the first entry, you can use BELLE as
> the datasource in the connection string. And for the second one, you can
> use BELLE\SQLEXPRESS as the datasource. HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>
Author
10 Mar 2006 5:49 AM
Kevin Yu [MSFT]
You're welcome.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

AddThis Social Bookmark Button