I am trying to understand how a connection string obtains its value in a C#.net 2008 application. By stepping through code,
I found that a connection string obtained its value from the following line of code:
RemotingConfiguration.Configure("Useall.Desktop.exe.config", false);
By doing a search on the .net application, I found the Useall.Desktop.exe.config file in the bin/debug folder of the application.
Thus I am wondering if the connection string information is initally obtained from the Useall.Desktop.exe.config file or would it obtain its inital values from an app.debug.config file?
Would you explain the .net remoting and configuration manager interdependency to me? If they are separate items, could you explain that to me? If not, would you point me to a reference to look up this issue?
Loading
DianePosted Jul 17, 2011, 3:17 PM
This is a C#.net 2008 professional version of visual studio.net connecting to a sql server 2008 r2 database. The application is a windows form (desktop) application. (This change entails moving from sql server 2005 to sql server 2008 r2. As part of the process, some of the database tables will be deleted and replaced with new tables.)
Question:
I want to mention the following so I can change the settings in the correct manner:
1. The properties are saved in the program settings of the appropriate project files. When I tried to edit the program settings, I got the following error message: Error 1 Property or indexer 'EnrolT.TableAdapters.Properties.Settings.EConnectionString' cannot be assigned to -- it is read only C:\Enr\EnrolT.TableAdapters\TableAdapterManager.cs 64 21 EnrollT.TableAdapters.
2, To get the application to run so far, I went into the "Useall.Desktop.exe.config" in the directory structure it was located at, and changed the values to what I want. (I could change this file since it is an XML).
3. I know there is a better way to change the values. However, I would like to know what the preferred method is since i do not know what it is.
4. Also this entire solution has 4 ways to build the entire application using the configuration manager. These four methods are: a. Release, b. Produc tion-debug,c. Debug, and d. Debug-test. Each configuration manager way has different connection strings, user names and passwords saved.
Thus would you explain the .net behind what I mentioned above and how the settings values are saved in each configuration manager?
I basically would like to know how to edit the settings listed above in the correct manner.
Sam HobbsPosted Jul 17, 2011, 3:05 AM
A connection string is a string. It is not an object with values. You are trying to ask for something but I don't know what that something is.