View Network SQL Servers
-
Hi guys, i just wrote a vb.net program. i need to be able to view all sql servers on the office network in order to generate a dynamic connection string. pls help.
He who goes for revenge must first dig two graves.
I don't think that a well configured SQL server is just going to sit on the network and broadcast out saying 'Hi, I'm an SQL Server, Why don't you try and hack me' You will need to get a list of the SQL servers from the relevant server admins, as well as which ports they accept connections on.
Dave Don't forget to rate messages! Find Me On: Web|Facebook|Twitter|LinkedIn Waving? dave.m.auld[at]googlewave.com
-
I don't think that a well configured SQL server is just going to sit on the network and broadcast out saying 'Hi, I'm an SQL Server, Why don't you try and hack me' You will need to get a list of the SQL servers from the relevant server admins, as well as which ports they accept connections on.
Dave Don't forget to rate messages! Find Me On: Web|Facebook|Twitter|LinkedIn Waving? dave.m.auld[at]googlewave.com
ok. thanx. now i understand. But pls how do i get this done. Plus, what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
He who goes for revenge must first dig two graves.
-
ok. thanx. now i understand. But pls how do i get this done. Plus, what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
He who goes for revenge must first dig two graves.
-
ok. thanx. now i understand. But pls how do i get this done. Plus, what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
He who goes for revenge must first dig two graves.
Creamboy wrote:
what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
If you're talking about connecting to an SQL Server over the internet, forget it. Noone in their right mind would EVER expose an SQL server directly to the Internet. You would notmally expose SQL functionality at the application level through a Web Service and have your app use the web service to do the work.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Hi guys, i just wrote a vb.net program. i need to be able to view all sql servers on the office network in order to generate a dynamic connection string. pls help.
He who goes for revenge must first dig two graves.
-
Creamboy wrote:
what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
If you're talking about connecting to an SQL Server over the internet, forget it. Noone in their right mind would EVER expose an SQL server directly to the Internet. You would notmally expose SQL functionality at the application level through a Web Service and have your app use the web service to do the work.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Get a little lost in the messages? His first question was about finding sql servers on his network...which there are ways to do that (see Tosch's response below for one). He was told by someone that apparently doesn't know a whole lot about it that it was a ridiculous idea. So, he instead asked how he would connect to a server he knew about. If you're trying to connect to an online server you just need to know what kind of server you're dealing with. If you know that, check out http://www.connectionstrings.com/[^] for examples.
-
Try
Sql.SqlDataSourceEnumerator.Instance.GetDataSources
This will give you a datatable with a row for each SQL-Server found in the network. Please read the helpfile for further info.Tosch
Strange. I used to use SmoApplication.EnumAvailableSqlServers()[^], but I like your method better. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
-
Get a little lost in the messages? His first question was about finding sql servers on his network...which there are ways to do that (see Tosch's response below for one). He was told by someone that apparently doesn't know a whole lot about it that it was a ridiculous idea. So, he instead asked how he would connect to a server he knew about. If you're trying to connect to an online server you just need to know what kind of server you're dealing with. If you know that, check out http://www.connectionstrings.com/[^] for examples.
No, not lost. Just commenting on what appeared to be a request to connect to an SQL Server directly connected to the 'Net. what about if i'm trying 2 connect my windows application to an online server (like on my website, www.mysite.com)?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...