jjones7947
October 1st, 2009, 02:02 PM
Same managed C++ Windows Service project in VS2008.
Trying to read a db connection string from my app.cfg file (properly named of course)
use the following code:
<code>
//First get the database name out of AppSettings section
String^ database = ConfigurationManager::AppSettings["database"];
// Now get the connection string for that db
ConnectionStringSettingsCollection strings = ConfigurationManager::ConnectionStrings::get;
ConnectionStringSettings settings = strings.default[database];
String^ connString = settings.ConnectionString;
</code>
I get C3673 compiler errors on both ConnectionStringSettingsCollection and ConnectionStringSettings that "class does not have a copy-constructor"
What is that all about? BTW it's the same with and without the "::get".
Jim
Trying to read a db connection string from my app.cfg file (properly named of course)
use the following code:
<code>
//First get the database name out of AppSettings section
String^ database = ConfigurationManager::AppSettings["database"];
// Now get the connection string for that db
ConnectionStringSettingsCollection strings = ConfigurationManager::ConnectionStrings::get;
ConnectionStringSettings settings = strings.default[database];
String^ connString = settings.ConnectionString;
</code>
I get C3673 compiler errors on both ConnectionStringSettingsCollection and ConnectionStringSettings that "class does not have a copy-constructor"
What is that all about? BTW it's the same with and without the "::get".
Jim