website - Web.Config file and Linq to Sql changing its place -


I have a strange problem with my project, it was a web site that is now converted to a web application that The solution is in Initially classes from Linux to SQL The DBML file was using, which had stored its connection string in /MyProject/web.config, the project ('web application') is in a solution and when I modify the linux SQL DBML file, then this web. The config file only creates a layer above its connection string, in errors in /mysolution/web.config, while I still have / MySolution / MyProject / web.config, there are errors with duplicate connection string names. So, how can I do LINQ in SQL just the web? Use the config file in / MySolution / MyProject / web.config, or my entire web. Config file that is considered in MySolution / web.config (I like to keep it! Thanks!

PS: Datacentes / MySolution / MyProject / MACOD / Models / MyDataConnect DBML

It appears that updating dbml would always force the root web configuration to be updated. Use the root web. Config, then your projector But you have one more choice.

Each folder can have its own configuration, which is why you get duplicate name exceptions if you take it around If you want, you can remove it first and add a connection string to the same name. If you do so, then your connection block ( /MySolution/MyProject/web.config ) Will look like the following:

  & lt; connectionStrings & gt; & Lt; remove name = "myConnectionString" /> gt; add name = "MyConnectionString" connectionString = "XXXXXXXXXX" provider name = "System.Data.SqlClient" /> & Lt; / ConnectionStrings & gt; As I said, I really can not recommend that you do this, because your DBML is still root web. Will save config, so it will not be easy for other developers to realize what is happening. 


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -