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/
精彩评论