Detecting instances of SQL Server

G

Guest

Hi,

I have a few projects with which I am using Access as a backend. I am
thinking about upgrading them to the .NET framework 2.0 and switching to SQL
Server. First I want to make sure I can still run the programs on a home
network environment. I want to be able to install the main SQL databases on
one computer and have other computers access those on the network. Is there
a way in VB 2005 for computers to search for instances of SQL on the network?

Thanks,
Nathan
 
S

Siva M

Check out System.Data.Sql.SqlDataSourceEnumerator.GetDataSources()

Hi,

I have a few projects with which I am using Access as a backend. I am
thinking about upgrading them to the .NET framework 2.0 and switching to SQL
Server. First I want to make sure I can still run the programs on a home
network environment. I want to be able to install the main SQL databases
on
one computer and have other computers access those on the network. Is there
a way in VB 2005 for computers to search for instances of SQL on the
network?

Thanks,
Nathan
 
K

Ken Tucker [MVP]

Hi,

Add a reference to microsoft.sqlserver.smo

Imports Microsoft.SqlServer.Management.Smo

Public Class Form1


Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim dt As DataTable



'Get list of servers

dt = SmoApplication.EnumAvailableSqlServers(False)

For Each dr As DataRow In dt.Rows

ListBox1.Items.Add(dr(0).ToString)

Next


End Sub
End Class



Ken
 
T

The Grim Reaper

Hi Ken,

I can't find that reference. I've got both SQL Server 2000 and SQL Server
2005 Express installed.
Is it only available with a proper SQL 2005 version??

TIA
___________________________________________
The Grim Reaper
 
T

The Grim Reaper

It wasn't my second problem - it was my first and only problem - I'm not the
OP!!

Thanks anyway - t'was a great help :D
_______________________________________________
The Grim Reaper
 
M

Michel van den Berg

Sorry my mistake, please don't kill me! ;)

The Grim Reaper said:
It wasn't my second problem - it was my first and only problem - I'm not
the OP!!

Thanks anyway - t'was a great help :D
_______________________________________________
The Grim Reaper
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top