Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: DirectX Pin
Heath Stewart30-Jun-04 5:47
protectorHeath Stewart30-Jun-04 5:47 
GeneralRe: DirectX Pin
MKlucher30-Jun-04 6:52
MKlucher30-Jun-04 6:52 
GeneralProblem with appending rtf data to a rich text box Pin
Ravikumar_mv29-Jun-04 23:13
Ravikumar_mv29-Jun-04 23:13 
GeneralRe: Problem with appending rtf data to a rich text box Pin
Ravikumar_mv30-Jun-04 2:00
Ravikumar_mv30-Jun-04 2:00 
GeneralRe: Problem with appending rtf data to a rich text box Pin
Dave Kreskowiak30-Jun-04 12:17
mveDave Kreskowiak30-Jun-04 12:17 
Questionhow to get sqlserver names in local net Pin
huangjinzhansh29-Jun-04 22:17
huangjinzhansh29-Jun-04 22:17 
AnswerRe: how to get sqlserver names in local net Pin
Guinness4Strength30-Jun-04 6:13
Guinness4Strength30-Jun-04 6:13 
AnswerRe: how to get sqlserver names in local net Pin
Heath Stewart30-Jun-04 6:56
protectorHeath Stewart30-Jun-04 6:56 
The simplest way is to use SQL-DMO. Right-click on your project and select Add Reference. Click the COM tab and find "Microsoft SQLDMO ..." in the list. Double-click to add it.

Your code is then as easy as this:
SQLDMO.Application app = new SQLDMO.ApplicationClass();
SQLDMO.NameList servers = app.ListAvailableSQLServers();
if (servers != null)
  foreach (string server in servers)
    Console.WriteLine(server);
You can also P/Invoke dbserverenum, though this is rumored to be unsupported in future versions (it's from an old C library). If you use SQLDMO, you'll need to redistribute the interop assembly that VS.NET will create when you add the COM reference to the SQL-DMO library. SQLDMO must be installed, however, on the target machine (this is done by SQL Server and the MSDE).

If you don't want to rely on such client requirements, you'll have to google the net to see if you can find the protocol used to detect SQL Servers on the network.

 

Microsoft MVP, Visual C#
My Articles
QuestionHow to implement Pin
John L. DeVito29-Jun-04 22:00
professionalJohn L. DeVito29-Jun-04 22:00 
AnswerRe: How to implement Pin
Colin Angus Mackay29-Jun-04 23:14
Colin Angus Mackay29-Jun-04 23:14 
GeneralRe: How to implement Pin
misterbear30-Jun-04 0:55
misterbear30-Jun-04 0:55 
GeneralRe: How to implement Pin
John L. DeVito30-Jun-04 8:17
professionalJohn L. DeVito30-Jun-04 8:17 
GeneralRe: How to implement Pin
Colin Angus Mackay30-Jun-04 8:56
Colin Angus Mackay30-Jun-04 8:56 
GeneralRe: How to implement Pin
John L. DeVito30-Jun-04 13:27
professionalJohn L. DeVito30-Jun-04 13:27 
AnswerRe: How to implement Pin
Werdna30-Jun-04 5:46
Werdna30-Jun-04 5:46 
GeneralRe: How to implement Pin
Werdna30-Jun-04 5:47
Werdna30-Jun-04 5:47 
GeneralCollection class with different class members Pin
pxp29-Jun-04 21:31
pxp29-Jun-04 21:31 
GeneralRe: Collection class with different class members Pin
Rakker7129-Jun-04 23:07
Rakker7129-Jun-04 23:07 
GeneralRe: Collection class with different class members Pin
pxp30-Jun-04 5:05
pxp30-Jun-04 5:05 
GeneralRe: Collection class with different class members Pin
Heath Stewart30-Jun-04 5:56
protectorHeath Stewart30-Jun-04 5:56 
GeneralRe: Collection class with different class members Pin
pxp30-Jun-04 7:32
pxp30-Jun-04 7:32 
GeneralRe: Collection class with different class members Pin
mav.northwind30-Jun-04 8:31
mav.northwind30-Jun-04 8:31 
GeneralRe: Collection class with different class members Pin
pxp30-Jun-04 23:41
pxp30-Jun-04 23:41 
GeneralRe: Collection class with different class members Pin
mav.northwind1-Jul-04 0:29
mav.northwind1-Jul-04 0:29 
GeneralRe: Collection class with different class members Pin
pxp1-Jul-04 3:28
pxp1-Jul-04 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.