views:

37

answers:

3

hi all,

my system is connected Trhough LAN..

totally four systems connected. and all systems having MS SQl server installed in it.

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

server names - for connection string...!!

thanx'

+1  A: 

Here's an article which demonstrates how to achieve this using SMO.

Darin Dimitrov
THanX it worked...!!
pvaju896
@pvaju896: If the answer helped then take a look at the big checkmark on the left. Also consider that SMO may not be (already) installed on every PC, even if it has .NET.
Henk Holterman
+1  A: 

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

Or System.Data.Sql.SqlDataSourceEnumerator

Martin Smith
THanX it worked...!!
pvaju896
+1  A: 
SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
System.Data.DataTable table = instance.GetDataSources();

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

Pierre 303
ThanX it also worked..
pvaju896