Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

net windows app.config change setting for sqlconnection in build

Posted on 2009-07-06
4
Medium Priority
?
532 Views
Last Modified: 2013-12-17
Hi

Have windows application in c# (.net) and using sql express - when developing have sqlconnection string in settings to local but when create exe for user/distribution I want to change the connection string in the app.config file

I thought it would fit in build events (pre or post) but cannot find code snippet to change values to user setting and after buil;d bakcto development

any ideas on code syntax or is there a better way to do it

Rgds
stephen
0
Comment
Question by:stephenwilde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 750 total points
ID: 24783991
0
 
LVL 13

Assisted Solution

by:Philip Pinnell
Philip Pinnell earned 750 total points
ID: 24783995
0
 

Author Comment

by:stephenwilde
ID: 24784077
Thanks

But in app config file using an application variable not full connection string for which is no option in my visual studio winddows application to do - and the syntax in pre/post build seems dos like dont wont 2 app config files to maintain as lots of other items/settings in them so would need syntax to change only a value

Rgds
stephen
0
 

Author Closing Comment

by:stephenwilde
ID: 31600100
Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question