app.config
-
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem. I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to). Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated. Thanks.
-
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem. I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to). Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated. Thanks.
I'd deploy a different app.config, or perhaps write code so that the debug version of your code reads one setting and the release, reads another. You do this with #ifdef DEBUG #else #endif in C#, I am not sure if VB is capable of that tho.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem. I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to). Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated. Thanks.
-
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem. I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to). Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated. Thanks.
You can consider something like this (change DEV_COMPUTER and TEST_COMPUTER to match the names of your computers):
<appSettings>
<add key="ConnectionString_DEV_COMPUTER" value="..." />
<add key="ConnectionString_TEST_COMPUTER" value="..." />
</appSettings>ConfigurationManager.AppSettings("ConnectionString_" + Environment.MachineName).ToString
-
I'm fairly new to VB.NET, (I was previously an ASP.NET develeper) and I have what a fairly trivial problem. I am developing a system for a client where the application gets data from a SQL Server database. I have the connection string to the database stored in the app.config file. But the problem lies in that I am using a different database when developing than that which will be used on the live system. So it means that each time I build the project to test on their machines, I have to remember to change the connection string settings before I do so (and in fact, there are other settings like file paths which need changing to). Like I said, a failry trivial isssue but if you guys have any suggestions on other ways to go about this then it would be appreciated. Thanks.
We allow the user to select the target server from a list when they logon. This then supports Dev/UAT/Production. Some of our apps will also have multiple scenario copies the user may need to use.
Never underestimate the power of human stupidity RAH