Developers community number 1 connection string reference

How to get the connection string dynamically using C#?

Posted 2010-10-20 08:37
by Arthur Llano
in the SQL Server Forum
I am developing an app in visual studio 2008. This app should run to any computer where it will be installed. I connect it to SQL 2005 express. SQL 2005 express will also be installed to the same computer where the app will be installed. How then can I get the connection string dynamically so I can run my app to any computer I want? Can anyone help me about this? Thanks! :)
Reply 2010-10-21 08:05
by Max Wikström
in the SQL Server Forum
Hi
If you use ".\SQLExpress" as server name it will connect to the local instance. Will this help? Not sure if I understood your question...
Max
Reply 2010-10-21 08:06
by Max Wikström
in the SQL Server Forum
Hi
If you use ".\SQLExpress" as server name it will connect to the local instance. Will this help? Not sure if I understood your question...
Max
Reply 2010-10-23 08:40
by Arthur Llano
in the SQL Server Forum
Hi Max!

Thanks for the reply. Anyways, it works! All I got to do is to truncate ".\SQLExpress" to my connection string.

Thank again! :)

Arthur
Copyright © 2012 ConnectionStrings.com   |   All Rights Reserved   |   Powered by CSAS   |   Send feedback, articles, requests and more connection strings here.