I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment.
<
The Enterprise Library configuration editor can help you do this. It allows you to create a base config file and then deltas for each environment. You can then merge the base config and the delta to create an environment-specific web.config. Take a look at the information here which takes you through it better than I can.