To save a database connection string in Config.web
Source: Internet
Author: User
There are several ways to save the database connection string in ASP, Asp+ provides another new way: Config.web. Many demos in QuickStart directly write the connection string in the program. This is no problem for demo purposes, but it's not going to work in practice.
This article demonstrates how to use Config.web to store connection strings. In every page asp.net you only need
Pull it up and you can use it directly. The advantage of this is safe, the second is convenient, change the password only need to change a place.
Cut the crap, here's the code: (Put it in the root directory of the application)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service