ConnectionString as app.config value  
Author Message
Torgeir F.





PostPosted: .NET Framework Data Access and Storage, ConnectionString as app.config value Top

In Visual Studio 2003/.net framework 1.1, I could use the designer of a component class to create an SqlConnection and then set the DynamicProperties of this object to use a config file key (app or web.config).

I can't find this option in Visual Studio 2005 when working with an SqlConnection object in a designer. Do I have to get this value from the config file by coding now



.NET Development7  
 
 
Paul P Clement IV





PostPosted: .NET Framework Data Access and Storage, ConnectionString as app.config value Top


The designer should be automatically adding connection string entries to the application config file. Did you look for the connectionStrings section

 
 
Torgeir F.





PostPosted: .NET Framework Data Access and Storage, ConnectionString as app.config value Top

I can't see any newly created connectionstring entries that matches the connectionstring I have used for the SqlConnection object in my component class, either in app.config or the settings window for the application (which is the same thing of course).

I have earlier created a couple of connectionstring entries to the settings of the application and would like to be able to select from these when working in the component class designer. In VS2003 you could do this by editing the connectionstring property and select "existing" or edit the DynamicProperties section and set the connectionstring to use a key from the config file.


 
 
Paul P Clement IV





PostPosted: .NET Framework Data Access and Storage, ConnectionString as app.config value Top


What steps did you use to create this connection I'm not exactly sure how you are working with it.