de news: %23OL7NBtrHHA.4768@TK2MSFTNGP02.phx.gbl...
Quote:
>Hi All
>>
>I have a really strange problem occurring in my application. When I read
>in the application settings for connection strings the following happens:
>>
>Here are my connection string settings -
><connectionStrings>
>>
><add name="TRM8.UI.My.MySettings.TRM8" connectionString="Data
>Source=SQLDATA;Initial Catalog=TRM8_PROD;Integrated Security=True"
>>
>providerName="System.Data.SqlClient" />
>>
><add name="TRM8.UI.My.MySettings.TRM8_Test" connectionString="Data
>Source=SQLDATA;Initial Catalog=TRM8_UAT;Integrated Security=True"
>>
>providerName="System.Data.SqlClient" />
>>
></connectionStrings>
>>
>Now when i read in these settings -
>>
>Private Sub New()
>_colConnectStrings =
>System.Configuration.ConfigurationManager.Connect ionStrings
>>
>'this is for test purposes
>>
>Dim conEnum As IEnumerator = _colConnectStrings.GetEnumerator()
>>
>Dim i As Integer = 0
>>
>While conEnum.MoveNext()
>>
>Dim name As String = _colConnectStrings(i).Name
>>
>Dim connectionString As String = _
>>
>_colConnectStrings(name).ConnectionString
>>
>Dim provider As String = _
>>
>_colConnectStrings(name).ProviderName
>>
>End While
>>
>'the above returns 3 (THREE) instances (all the same) of the following:
>>
>'name = "LocalSqlServer"
>>
>'connection string = "data source=.\SQLEXPRESS;Integrated
>Security=SSPI;AttachDBFilename=|DataDirectory|asp netdb.mdf;User
>Instance=true"
>>
>'provider = "System.Data.SqlClient"
>>
>End Sub
>>
>The consequence of the above is that I cannot get a connection to my
>database (Sql Server 2005) as the _colConnectStrings collection does not
>contain my real connection strings.
>>
>I do NOT have any setting like it in the app config file, neither do I
>have SQLExpress installed on my development machine. I have tried
>removing my connection strings from application settings, closing VS and
>resetting the connection strings. The project is quite large with some
>90k lines of code. VB.Net 2005 running on WinXP SP2.
>>
>This one has me beat. I am unable to find any help on this anywhere.
>>
>Thank you in advance for any help you can provide.
>>
>>