Are you building an ASP, Windows Forms, XML web service or what?
Each of these architectures has different requirements for the Connection
string.
Based on some of your other questions, I'm going to assume that you want to
create a Windows Forms application that accesses SQL Server. So, why would
you want to change the connection string? To set the user credentials? Well,
in this case it might make sense to use an application-based set of
credentials that does not change. You might also consider using "trusted"
(SSPI) authentication in which case the connection string does not change.
If you're planning to use the User Instance feature, you probably are going
to need to use SSPI in which case the connection string does not change.
You also might benefit from the day-long workshop I'm giving in Vancouver BC
on November 26th (DevTeach).
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com www.betav.com/blog/billva Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit
www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
[quoted text, click to view] "Mike TI" <tanveer@creativepk.com> wrote in message
news:u%23%23%23003GIHA.3600@TK2MSFTNGP06.phx.gbl...
> Oct 30, 2007
>
> Hi all
>
> Using VB.Net 2005 & SQL 2005.
>
> I tried to use a database on my local PC and a remote database.
>
> Now is there a way I can make the connection string flexible. I tried to
> change the connection string in the APP.CONFIG file however I was not
> successful. It would be nice if I am able to store the connection string
> in
> some kind of a text file.
>
> What I may be doing wrong.
>
> Mike TI.
>
>
>
>