Click here to Skip to main content
Sign Up to vote bad
good
See more: C#VB.NET
I'm Making Report Designer Its generate Report Of all type Of different database Like excel,access,sqlserver, oracle
 
But Problem Is that I'm Fail Getting All Sql Server Instance Name
My code giving only server name like PC name not Instance name like SQL Express
 
here My code
public static SqlDataSourceEnumerator Instance = SqlDataSourceEnumerator.Instance; //Get server Names
public static DataTable Table = new DataTable();
Table = Instance.GetDataSources();
But Its Not Giving Instance Name
what wrong With My Code
Any Another Way To Get SQL Server Instance Name
Please............ Help Me Fast
 

thanks In Advance
Posted 23 Sep '12 - 22:19
ankur4801.2K
Edited 23 Sep '12 - 22:32
lukeer9.9K


1 solution

Your code looks very similar to the example in MSDN[^].
Have you tried the second part (DisplayData()) as well?
Maybe the instance name is delivered in another column than the one you looked in.
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 355
1 Arun Vasu 345
2 Sergey Alexandrovich Kryukov 338
3 Maciej Los 208
4 Zoltán Zörgő 189
0 Sergey Alexandrovich Kryukov 9,755
1 OriginalGriff 7,559
2 CPallini 4,018
3 Rohan Leuva 3,362
4 Maciej Los 2,951


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid