I need a mechanism for locating SQL server instances

Posted by SzamDev on Stack Overflow See other posts from Stack Overflow or by SzamDev
Published on 2010-04-06T06:50:45Z Indexed on 2010/04/06 7:43 UTC
Read the original article Hit count: 178

Filed under:
|
|

Hi

I have an idea and I want to apply it to my Application (C# .NET).

When we connect to a DB (MS SQL Server 2008) in VS 2008, the ConnectionString saved in the Application Setting and it's a static varriable (no one can edit it unless you edit it inside VS 2008).

I want a way to let my Application search for MS SQL Server and save it to Application Setting and use it to connect to my DB Programmatically.

When my application start, the first thing to do is checking the ConnectionString if vaild, NOT Empty and test connection to MS SQL Server Successfully so if there is a proplem I think to show a window form to let the user enter some data like username and password for MS SQL Server 2008

Is there any way to do it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about database