开发者

how to retrieve the names of servers that i can connect to..?

开发者 https://www.devze.com 2023-01-06 09:19 出处:网络
my system is connected Trhough LAN.. totally four systems connected. and all systems having MS SQl server insta开发者_StackOverflow中文版lled in it.

my system is connected Trhough LAN..

totally four systems connected. and all systems having MS SQl server insta开发者_StackOverflow中文版lled in it.

now i need to retreive that - which all server's i can connect to..?

server names - for connection string...!!

thanx'


You can use SMO for this. Example here http://www.sqldbatips.com/showarticle.asp?ID=45

Or System.Data.Sql.SqlDataSourceEnumerator


SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
System.Data.DataTable table = instance.GetDataSources();

Check this open source project for more: http://dataconnectionsuite.codeplex.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消