G
Guest
Hi,
I'm creating an application that has to connect sequentially to different
tadabases.
I added all the connection strings to app.config and I'm itterating through
them in the following manner:
foreach (ConnectionStringSettings connStringSettings in
ConfigurationManager.ConnectionStrings)
{
........
connection = new SqlConnection(connStringSettings.ConnectionString);
.........
}
and I get:
connStringSettings.ConnectionString =
"data source=.\\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
which is completly different from what I have in my connection string. I
don't even know where this values is comming from.
But if I do
ConfigurationManager.ConnectionStrings["MyConnString1"].ToString(),
ConfigurationManager.ConnectionStrings["MyConnString2"].ToString()
I get the correct values from app.config.
Where is the \\SQLEXPRESS connections string comming from and how can I
itterativly get the correct connection string values?
Thanks
I'm creating an application that has to connect sequentially to different
tadabases.
I added all the connection strings to app.config and I'm itterating through
them in the following manner:
foreach (ConnectionStringSettings connStringSettings in
ConfigurationManager.ConnectionStrings)
{
........
connection = new SqlConnection(connStringSettings.ConnectionString);
.........
}
and I get:
connStringSettings.ConnectionString =
"data source=.\\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
which is completly different from what I have in my connection string. I
don't even know where this values is comming from.
But if I do
ConfigurationManager.ConnectionStrings["MyConnString1"].ToString(),
ConfigurationManager.ConnectionStrings["MyConnString2"].ToString()
I get the correct values from app.config.
Where is the \\SQLEXPRESS connections string comming from and how can I
itterativly get the correct connection string values?
Thanks