Re: Enumerate SQL servers on net, create connection strings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You don't need SMO. Use the .NET Factory classes to do this search the archives of this list for an example I posted some time ago drawn from an example in my book.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________



"Bob" <Bob@xxxxxxxxxx> wrote in message news:u796g4lbn764vsgfunlq8urj4gacmc563n@xxxxxxxxxx
On Fri, 24 Oct 2008 12:50:52 -0500, "Gregory A. Beamer \(Cowboy\) -
MVP" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote:

You can feel out with DMO (COM) and SMO (not 100% sure about this, but I
would assume it has all of the discovery functionality of DMO).

Connection strings are fine, as long as you have a trusted connection. But,
without one, you would not be able to connect to the server anyway to use
DMO or SMO.

The connection strings you create will not necessarily work for end users,
however, as they must belong to a group that has rights.

Here is a link to SMO:
http://msdn.microsoft.com/en-us/library/ms162169.aspx

You can also find some info in SQL Server 2005/2008 BOL. There is also DMO
info in BOL.

Thanks for your reply, Gregory. I thought there would be a
'formulated' way to do this, as SMS is able to bring up a list.

I'm not a database-oriented programmer, but have to make use in a
project. One of the things I was puzzled by: There are several folders
inside the Program Files\Microsoft SQL Server folder, called MSSQL.1,
.2, etc. I'm told that they may be remnants from previous installs of
SQL server versions, but that sounds odd. These apparently map to
different 'virtual servers', one of which does -not- come up directly
in the SMS/Visual Studio connection menu. That particular one looks
like it maps to the connection string using (local).

This is the type of info that is difficult to find, perhaps because I
don't know appropriate search keys. Do you happen to know where I
could find info on how those folders are mapped?

Or even why the obvious (local) or its equivalent is not mapped to one
of the connections brought up in the SMS/Visual Studio menus? (IOW,
none of the DBs ref'd by the VS2008 connections has the data that was
stored via program using (local) in the connect string).


.



Relevant Pages

  • Re: connect to named instance w/ non-default port
    ... An error has occurred while establishing a connection to the server. ... under the default settings SQL Server does not allow remote connections. ... the following connection strings do not work. ...
    (microsoft.public.sqlserver.connect)
  • Re: Enumerate SQL servers on net, create connection strings
    ... Connection strings are fine, as long as you have a trusted connection. ... DMO or SMO. ... You can also find some info in SQL Server 2005/2008 BOL. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ASP .NET 2 Remoting User identity
    ... application connects to MS SQL with a trusted connection. ... So now none of the database connection strings have users or ... if you have used SQL Server on the back-end of an ASP.NET ...
    (microsoft.public.dotnet.languages.csharp)
  • Connecting to SQL Server 2000 with VB.net on Pocket PC 2003
    ... I have been trying to create a connection to my SQL Server 2000 from ... over a wireless network connection. ... in connection strings, but always have the same problem. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: List availalbe SQL Servers?
    ... available for making a connection to (if you know its server and ... one reason being that network ... Should SQLEXPRESS be included in the list from SMO (see my response to ... Express, and it only finds the SQL Server 2000 instance, whereas SQL ...
    (borland.public.delphi.database.ado)