473,785 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listing database servers on local network

DKC
Hi All,

Is there any way wherein I can get a list of database servers on my local
network.
Any help appreciated.
I am using VB.NET 2003

Thanks
DKC
Nov 20 '05 #1
2 1739
Hi DKC

Some sample code, (I think it is only for SQL servers however I do not know
it because the sample is not from me)

However maybe you can use it.

Cor

\\\
Private Function LoadSQLServerLi st() As Integer
Dim serverIndex As Integer
Dim sqlServers As SQLDMO.NameList
Dim sqlServer As Object
' Get a list of servers
sqlServers = New SQLDMO.Applicat ion().ListAvail ableSQLServers( )
' Iterate through the server names, and add it to the combobox
For Each sqlServer In sqlServers
If Not sqlServer Is Nothing Then
cboServers.Item s.Add(sqlServer )
End If
Next
' Send back the count of servers
LoadSQLServerLi st = cboServers.Item s.Count
'table list in a ser
Dim sqlServer As SQLDMO.SQLServe r
Dim sqlDB As Object
sqlServer = New SQLDMO.SQLServe r()
Try
' Connect to your database with userID and password
sqlServer.Conne ct(cboServers.T ext, txtUserID.Text, txtPassword.Tex t)
' Check for database names in the server
' This loop adds the database name to another combobox
For Each sqlDB In sqlServer.Datab ases
If Not sqlDB.Name Is Nothing Then
cboDatabases.It ems.Add(sqlDB.n ame)
End If
Next
Catch Exp As Exception
MsgBox(Exp.ToSt ring)
End Try
////
Nov 20 '05 #2
DKC
Thanks Cor,

Gave me enough input to proceed further.

Regards,
DKC
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OW******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi DKC

Some sample code, (I think it is only for SQL servers however I do not know it because the sample is not from me)

However maybe you can use it.

Cor

\\\
Private Function LoadSQLServerLi st() As Integer
Dim serverIndex As Integer
Dim sqlServers As SQLDMO.NameList
Dim sqlServer As Object
' Get a list of servers
sqlServers = New SQLDMO.Applicat ion().ListAvail ableSQLServers( )
' Iterate through the server names, and add it to the combobox
For Each sqlServer In sqlServers
If Not sqlServer Is Nothing Then
cboServers.Item s.Add(sqlServer )
End If
Next
' Send back the count of servers
LoadSQLServerLi st = cboServers.Item s.Count
'table list in a ser
Dim sqlServer As SQLDMO.SQLServe r
Dim sqlDB As Object
sqlServer = New SQLDMO.SQLServe r()
Try
' Connect to your database with userID and password
sqlServer.Conne ct(cboServers.T ext, txtUserID.Text, txtPassword.Tex t)
' Check for database names in the server
' This loop adds the database name to another combobox
For Each sqlDB In sqlServer.Datab ases
If Not sqlDB.Name Is Nothing Then
cboDatabases.It ems.Add(sqlDB.n ame)
End If
Next
Catch Exp As Exception
MsgBox(Exp.ToSt ring)
End Try
////

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5475
by: Oliver Braun | last post by:
I know this is a very common issue and I found a lot of hints on this topic in www but I did not find a very good solution for this task. Most of the solutions use SQLDMO to list all sql servers in the network like this C# code: public static string GetAvailableSQLServers() { // declare arraylist to hold results ArrayList servers = new ArrayList();
5
3699
by: premmehrotra | last post by:
I currently have a multi-user access database which is put on a shared drive L: on a Windows Servers. Entire database is one file premdb.mdb. Users access this database from their laptops. Following problems occur: 1. Access is way too slow in WAN environment. Server is located in New Jersey and users are in California and Puerto Rico. 2. Database often becomes corrupt 3. When one user updates some data in the database, other users...
7
2380
by: nydiroth | last post by:
Our servers went down for over 6 hours yesterday and I was asked if there was a way to store the database on the server and a local station at the same time. My datbase is split and the tables are linked. Would there be a way to modify the table links to direct them to two seperate backends? Could there also be a non-linked table stored in the frontend alongside the table links? Our endpoint would be to have a mirror on the network...
6
4343
by: Jeff | last post by:
Has anyone had any luck accessing an Oracle database from a web service? I have a C# DLL with various code to query an Oracle database. If I call the methods in this DLL from a Windows Forms application everything works just fine. However, if I call the methods in this DLL from a web service, I receive the following error when the database connection is opened: Error: ORA-12154: TNS:could not resolve service name Does anyone know...
3
4555
by: John Barr | last post by:
Does anyone know how to search for Instances of SQL Server running on your network through code to populate a drop down like is done in the SQL Server Query Analyzer, and then once an instance is selected, list the databases on that Instance?
5
2486
by: Michael C | last post by:
....on a remote machine? Thanks, Michael C.
3
1804
by: lieven.becue | last post by:
Situation: at work we have a windows 2003 server with MS sql server 2005 express. With my pc at work, I can see my own database I created. At home. I can connect with VPN to the network. With extern desktop I can see the database and do everything. Now I want to create a login with visual web developer 2005 express. But when I try to login with sql server authentication I don't see any database. When I try windows authentication, I have...
0
1148
by: Axlin | last post by:
Hi. Could someone tell me what did i miss out in my steps when i configured our production database to our development database? I tried on 2 separate servers and also between 2 separate instances on our development server, but it didn't work.No error after configuring Log shipping though. Between the 2 servers - the transaction logs was backup every 1min on the pri server but log files just didnt transfer to secondary database. ...
5
2543
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs and registration keys, so I'm certain that the two machines are as similar as they can be.
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10153
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.