简体   繁体   中英

Change TableAdapter XSD to use Web.config Connection String Instead of App.config

I was given an asp.net/c# web form application to support. It has a website project, business layer, and data layer. The data layer has many xsd files with tableadapters. These table adapters point to the data layer's app.config/settings file to get the database connection string. I'd like to have the xsd files use the connection string in the website project's web.config file instead so that I can have the database connection in 1 single configuration file instead of 2 different ones. How can I go about doing this?

When I go to the connection properties of the tableadapter I only see the app.config connection strings.

I believe we figured it out. The problem was that while the connections in the web.config and app.config had the same name, the xsd files were using the full name, so we added connections to the web.config file along the lines of "datalayer.properties.settings.ConnectionName" and then removed the app config and cleared the connections from the settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM