If we have two sets of data, I.e. two databases... one for our test environment and one for our live environment, we can make life easier by using the following code snippet to establish which database to use, depending upon the build type!
#if RELEASE
// Use release database here
#else
// Use test database here
#endif
(RELEASE can also be switched to DEBUG for the reverse effect).
When the build method is changed within VS.NET, the relevant code (for its build type) is highlighted and the code un-used is grayed out.
No comments:
Post a Comment