Miha
Sat Jun 10 12:57:06 CDT 2006
Yes, I see.
I guess that this entry serves to aspnet applications for default database
when one is needed.
I would suggest you to ignore the entry
(connStringSettings.Name=="LocalSqlServer).
--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
"Vi" <Vi@discussions.microsoft.com> wrote in message
news:BB7F4F85-431D-46A7-BF9B-1FEEC38EFEE1@microsoft.com...
> no, this is a Windows Forms app, but ultimatly will be a Windows Service.
> Thanks
>
> "Miha Markic [MVP C#]" wrote:
>
>> Are you doing asp.net?
>>
>> --
>> Miha Markic [MVP C#]
>> RightHand .NET consulting & development www.rthand.com
>> Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Vi" <Vi@discussions.microsoft.com> wrote in message
>> news:F1C1712D-57E3-4472-8BE4-5D4FF9EF984F@microsoft.com...
>> > I'm using C# and VS.NET2005
>> > When I'm doing
>> > ConfigurationManager.ConnectionStrings)
>> > {
>> > ........
>> > connection = new SqlConnection(connStringSettings.ConnectionString);
>> > .........
>> > }
>> > the first itteration has connStringSettings.ConnectionString = "data
>> > source=.\\SQLEXPRESS;Integrated
>> > Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
>> > Instance=true"
>> >
>> > , which I don't know where it is comming from.
>> >
>> > The itteration 2 and 3 have the expected values that I inserted in
>> > app.config.
>> > Thanks
>> >
>> >
>> > "Cor Ligthert [MVP]" wrote:
>> >
>> >> Vi,
>> >>
>> >> Are you using C++ in the VS2002 version or something else, without
>> >> knowing
>> >> this it is helping with finding a needle in a meadow?
>> >>
>> >> Cor
>> >>
>> >> "Vi" <Vi@discussions.microsoft.com> schreef in bericht
>> >> news:EDFBA4AF-0F89-400B-9F3D-4D8069649954@microsoft.com...
>> >> > 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
>> >>
>> >>
>> >>
>>
>>
>>