Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings
Connection String in My.Settings Connection String in My.Settings
Connection String in My.Settings
Go Back  Xtreme Visual Basic Talk > > > Connection String in My.Settings


Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2006, 01:46 PM
Aquila's Avatar
Aquila Aquila is offline
Contributor
 
Join Date: Oct 2002
Location: Ocala, Fl.
Posts: 597
Default Connection String in My.Settings


I'm using VB2005

Question, When I go to distribute my application... and the database will no longer be on a local drive... how do I change the my.settings connectionstring that I use to connect to my dev copy of the database?

I've.... never actually thought about it until now. Which is severely stupid I know, but... anyone?

And I mean programaticly change it. Different sites will have different network paths to the database and I need to be able to set that up individually without recompiling every time with a new connectionstring.
__________________
Plotting to take over the world since 1978
Reply With Quote
  #2  
Old 09-19-2006, 07:52 PM
krixna krixna is offline
Newcomer
 
Join Date: May 2005
Posts: 9
Default

If you already deploy your program, and dont want to make a change or recompiling it. You can open up your application config file (ApplicationName.exe.config) with a notepad and change the value of your connectionstring setting.

If you want to programaticly change it. Then your connectionstring setting have to be a user scope. Then you'll be able to change it at runtime.
You can deploy your program with empty connectionstring, and at the program first execution detect the empty string and prompt the user to input the connectionstring.
Reply With Quote
  #3  
Old 09-20-2006, 06:13 AM
Aquila's Avatar
Aquila Aquila is offline
Contributor
 
Join Date: Oct 2002
Location: Ocala, Fl.
Posts: 597
Default

Quote:
Originally Posted by krixna
If you already deploy your program, and dont want to make a change or recompiling it. You can open up your application config file (ApplicationName.exe.config) with a notepad and change the value of your connectionstring setting.

If you want to programaticly change it. Then your connectionstring setting have to be a user scope. Then you'll be able to change it at runtime.
You can deploy your program with empty connectionstring, and at the program first execution detect the empty string and prompt the user to input the connectionstring.
Ah, Excellent... thank you.
__________________
Plotting to take over the world since 1978
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings Connection String in My.Settings
Connection String in My.Settings
Connection String in My.Settings
 
Connection String in My.Settings
Connection String in My.Settings
 
-->