How do you usally do when you have 2 different databases, one for development and one for the release? The databases is identical. I need a way to have one of the databases connected to the release version and one connected to the development/testing version. There has to be a easy way to do this that i just dont know about?
Asked
Active
Viewed 72 times
0
-
You need to provide more context to your question. How do we do **what**? – freefaller Sep 07 '12 at 09:12
-
What you want to do and what actual problems you getting? – Kaushal Sep 07 '12 at 09:12
-
As far as the *schema management*, I use ApexSQL and RoundhousE which I [discussed in this reply](http://stackoverflow.com/questions/11461707/database-version-control-for-mysql/11461909#11461909). – Sep 07 '12 at 09:17
-
I have edited my question a bit. – Sultanen Sep 07 '12 at 09:23
-
So you're talking about different connection strings for the different databases? How are you currently storing and using the connection string? – freefaller Sep 07 '12 at 09:23
-
I keep separate db connection strings in the different web.config files and avoid copying the web.config from development to release. – tomsv Sep 07 '12 at 09:29
-
The connectionstring is stored in the DB project settings, it seems to work if i change the value there... i rest my case... But how do i get it to automatically select the release database when i "publish" the application with the built in ClickOnce? And if i just have the built exe i whant to have it with the test database. – Sultanen Sep 07 '12 at 09:38
1 Answers
2
There are so many ways to do this, and the first is to manually edit your app or web config file.
You could also maintain several copies of your app config. It is very typical to have a seperate app.config values for dev, qa, and production. You can then use the post-build events to rename or otherwise setup the output you want.
You can also use conditional compilation to detect if you are debug vs release, and pull your connect string from a different app setting.

tcarvin
- 10,715
- 3
- 31
- 52
-
I think that conditional compilation will be the anwer to this, i think that i can use it to achive what i want. – Sultanen Sep 07 '12 at 23:25