|In a C# 2010 windows application, I am getting the following error message:
"The connection property in the Application Settings file is missing or incorrect. The connection string from the .dbml file has been used in its place".
I am also getting the warning message: warning CS0618: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete,
it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings".
What I am trying to do is obtain the connection string information from the app.configuration file instead from the app settings file.
To accomplish this goal I am chanigng the *designer.cs to use the following code to obtain the connection string information:
The app.configuration file looks like the following:
<add name="DEVConnectionString" connectionString="Data Source=dev2008;Initial Catalog=DEV;Integrated Security=True"
The above code works fine when I setup the code initially.
However once I reopen the soltuion file, I get the message listed above,
""The connection property in the Application Settings file is missing or incorrect.
The connection string from the .dbml file has been used in its place".
To solve this problem, I was trying to do the following steps:
1.Step 1: Right click on the .DBML file and select "Run Custom Tool".
2.Step 2: Set "Application setting = false" in the connecton properties of your DataContext.
3.Step 3: press "Save All".
The problem with the above solution is once I selected "Run Custom Tool", nothing happened. There was nothing for me to select.
Thus can you tell me and/or show me in code how to solve this problem?