开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜