 |
|
 |
Full code not included (e.g., buttonSQLServerEnumerator event handler not found)
|
|
|
|
 |
|
|
 |
|
 |
To find SQL-2005 and SQL-2008-servers one needs to use another driver specification. Later versions will find earlier versions.
SQL2008: Driver={SQL Server Native Client 10.0}
SQL2005: Driver={SQL Native Client}
-SQL2000: Driver={SQL Server}
NB. SQL2005 will find SQL2008-servers.
To find your drivers - HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
|
|
|
|
 |
|
 |
Enumerate instances:
DataTable table = SqlClientFactory.Instance.CreateDataSourceEnumerator().GetDataSources();
Dump into XML:
table.WriteXml("sql-servers.xml");
Vasek
|
|
|
|
 |
|
 |
y its even more simplified !!!!!!!!!
|
|
|
|
 |
|
 |
Y its simplified and worked for me!!!!!!!!!
|
|
|
|
 |
|
 |
...but it would be interesting to for e.g. get all SPs from browsed databases and so on. Do you know how to get that?
_____________________________
...and justice for all
|
|
|
|
 |
|
 |
Hi, I would like to use some of your code from the SQLInfoEnumerator class, and am wondering what license you release this code under. I will be releasing it as an open source software, nothing commercial.
|
|
|
|
 |
|
 |
feel free to use the code ( a mention of me would be nice ) anyway you wish but it is provided as is with no warranties/guarantees etc
|
|
|
|
 |
|
 |
this article helped me much ,great work, but it didnt returns existing databases in sqlservers,.
I am using windwows sever 2003, full permissions. also enable the Tcp/IP and piped connections.
Pls help.
kssk
|
|
|
|
 |
|
 |
HI, Its a great idea, but i will use the code and tell you !!
Thanks !!!
regards,
ram
|
|
|
|
 |
|
 |
Thanks a lot for your great code.
It's now used in a Open Source Microcredit software (www.octopusnetwork.org).
This software is currently used in Afghanistan! (kabul, mazar, maymana and charikar)
|
|
|
|
 |
|
 |
Dear fellows, Hi!
I am facing a problem in creating ODBC for SQL Server 2000. the scenerio is as:
I have a SQL Server named DBServer (Machine Name=DBServer and SQL Instance Name=DBServer as well). I installed another instance name DBServer2 on same machine.
Now the problem is, I made a Database named Accounts1 in second instance named DBServer2.
In odbc creation I can see server as DBServer\DBServer2 and dtabase nameAccounts1 but on connectivity I receive error message
"General network error, please contact your network administrator."
on sql-server machine the odbc is created without error but on the other machines that dont have sqlserver raise the said error. I am unable to fine the solution.
If some one know the solution or place where I am making mistake then please email me the solution at sirkaleem@hotmail.com or sirkaleem@yahoo.com.
Thanks,
Take Care,
-- Ch. Kaleem Ahmad --
Love For All Hate For None
|
|
|
|
 |
|
 |
Hi Murray
Great arcticle.
I have one doubt about fetching the list of running msde instances through c#.
I have 3 instances of MSDE installed on my machine say for example
MACHINE11\DBSTORAGE1
MACHINE11\DBSTORAGE2
MACHINE11\DBSTORAGE3
Now through c# using SMO or SQL DMO when I retreive the list of sql server instances, I get only the default instance. How can I get the list of named instances like above.
Can you pls help me with this.
Rajesh
|
|
|
|
 |
|
 |
I have two instances installed on my computer (Win XP), one is "machinename\TEST1", and another is "machinename\TEST2". These instances are sometimes enumerated and sometimes not. Is there anybody who knows the reason?
Thanks.
Wenxiang Tao
|
|
|
|
 |
|
 |
Hi Tao
I have the same problem.
Did u get any resolution for this
pls do let me know
Rajesh
|
|
|
|
 |
|
 |
Same problem for me...
.:: The Conquerors addict | Never surrender ::.
|
|
|
|
 |
|
 |
that's what I needed
|
|
|
|
 |
|
 |
The code will return no instance of the server, i.e. it would display SERVER2000 instead of SERVER2002/Production.
Furthuremore, it would also display (local) for the local SQL server, while the local SQL server has a full name, so trying to use (local) in a SQL connection string would not even work.
Any thoughts on that?
Thanks.
Sarajevo, Bosnia
|
|
|
|
 |
|
 |
if you need (local) replaced by the name of the computer, then just replace it.
(local) works in SQL connection strings. In ADO for sure, I use it all the time. ODBC think so too.
|
|
|
|
 |
|
 |
Greatest article on enumerating sql servers i've read!!! Read many other's how-tos, but NONE was functioning for me for various reasons...
MANY THANKS!!!
|
|
|
|
 |
|
 |
Can you use the same procedure used with SQLBrowseConnect for other databases, such as Oracle?
Thanks
Himmett
|
|
|
|
 |
|
 |
well, how about start/pause/stop a server
Regards,
unruledboy@hotmail.com
|
|
|
|
 |
|
 |
Hi,
I had the same problem. It's really simple to solve:
first you have to add the 'System.ServiceProcess' link to your project.
Than you can use
ServiceController[] services = ServiceController.GetServices();
and search the services for service.ServiceName == 'MSSQLSERVER'
If you have ound it, you can use Start(), Stop() ... (look at the help files for 'ServiceController' to see the possibilities)
that's it.
I'm not sure how the SqlServer service is named, when there are running multiple instances, but that should possible to find out.
Have a good work
|
|
|
|
 |
|
 |
Hi Eamonn,
Thanks for a terrific sample. I am trying to use your sample in my open source project. It works great and I've run into a couple of details. If I wanted to allow my users to use "Trusted Connection" (i.e. no username and password) how would I go about this. Also, if the username / password are incorrect the database list shows the available sql servers??? How can this be modified to simply raise an invalid login messagebox? You've done some great work here and I really do appreciate it.
Take care,
Chris
|
|
|
|
 |