Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Experts,

For getting the list of sql servers instances on the i am using the below code.
C#
SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; 
public DataTable GetInstances()
        {
           
       DataTable dtInstancesList = new DataTable();
       dtInstancesList = instance.GetDataSources().Select("", "ServerName ASC").CopyToDataTable();
            
        return dtInstancesList;
        }

I am getting the server list, its working fine.
But the problem here is,
In my network we are having two domains like A and B.

1. If i run this code in Domain A:
I am getting full list of SQL server instances.
for example here i am getting count is 100

2. If i run the same code in Domain B:
I am not getting the full list of SQl server instances.
for example here i am getting count is 10

Why this is happening, please let me know the solution.
Posted
Updated 12-Jun-13 21:14pm
v4

1 solution

Read This[^]

Try reading the above about full trust, network traffic, and other factors that lead to why you may not get all the instances.
 
Share this answer
 
Comments
D-Kishore 12-Jun-13 23:28pm    
Yes you are right, is there any solution to get the full list.
still i have confusion- why in Domain A getting full list and why in Domain B not getting full list.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900