Modify the connection string in LINQ to SQL

Source: Internet
Author: User

If the settings.settings file is automatically generated in the class library after you add LINQ to SQL and the database server is connected, the App. Config file is used to store the connection string (figure I)

If you want to modify the connection string, which one or all of them should be modified? After my research found that the simplest only need to modify dbml a file, because the three are related, DBML modified after the other two files will be modified accordingly, but this is in order: DBML, Settings.settings and App. Config, modifying one of the connection strings will synchronize the connection strings in the file afterwards. Otherwise, the reverse modification will be troublesome, such as modifying the connection string in app. Config (the name of the connectionstrings node is named according to the project name. Properties.settings. Connection string name rule naming) must open the Settings.settings file before Can prompt the update, after the update setting.settings must open dbml and re-select the current connection to prompt for updates dbml

However, sometimes it is not possible to directly modify the dbml, such as the development machine can not connect to the database server and modify the connection in dbml to connect to the database server (Figure IV) can only modify settings.settings and move the DBML connection drop-down option.

Modify the connection string in LINQ to SQL

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.