J
jvcoach23
I'm using VB 2008. I installed the 2008 Web Deployment Setup. I've done
this with asp.net apps in 2005. Anyway.. here is the problem. I want to
create several solution configurations. This is a silverlight 2 application
that is using a web service to drive the data. in the webservice solution
there is a file called ConnectionString_debugTest.config file. inside that
file
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="VerseSql" connectionString="Data
Source=(local);Uid=TestId;Pwd=TestPw;Initial Catalog=dbTest"/>
</connectionStrings>
in the added Web deployment project configuration, with the Test
configuation as the active one, under deployment, Web.config file section
replacements i've added the following
connectionStrings=ConnectionString_debugTest.config;
in the web service asmx.vb file that makes the db call is the following
Dim dbcon As String =
WebConfigurationManager.ConnectionStrings("VerseSql").ConnectionString()
cn = New SqlConnection(dbcon)
the problem is that when i run this and look and see what it's going after,
it says this
Referenced object has a value of 'nothing'
So i tried this instead
Dim connectionStrings As ConnectionStringSettingsCollection =
WebConfigurationManager.ConnectionStrings
Dim connectionStringsEnum As IEnumerator =
connectionStrings.GetEnumerator()
this give me a little more info.. it responses
? connectionstrings.Item(0)
{System.Configuration.ConnectionStringSettings}
ConnectionString: "data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
Instance=true"
ElementInformation: {System.Configuration.ElementInformation}
LockAllAttributesExcept:
{System.Configuration.ConfigurationLockCollection}
LockAllElementsExcept:
{System.Configuration.ConfigurationLockCollection}
LockAttributes: {System.Configuration.ConfigurationLockCollection}
LockElements: {System.Configuration.ConfigurationLockCollection}
LockItem: False
Name: "LocalSqlServer"
ProviderName: "System.Data.SqlClient"
the connection string is not getting picked up.
So i look at the build order for this solution.
It's order is
1. silverlight
2. web site
3. web deployment
so if i'm reading this right, the web deployment shoudl be #1 so that it can
pick up the settings.
can someone help out and tell me where i've gone astray.
thanks
shannon
this with asp.net apps in 2005. Anyway.. here is the problem. I want to
create several solution configurations. This is a silverlight 2 application
that is using a web service to drive the data. in the webservice solution
there is a file called ConnectionString_debugTest.config file. inside that
file
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="VerseSql" connectionString="Data
Source=(local);Uid=TestId;Pwd=TestPw;Initial Catalog=dbTest"/>
</connectionStrings>
in the added Web deployment project configuration, with the Test
configuation as the active one, under deployment, Web.config file section
replacements i've added the following
connectionStrings=ConnectionString_debugTest.config;
in the web service asmx.vb file that makes the db call is the following
Dim dbcon As String =
WebConfigurationManager.ConnectionStrings("VerseSql").ConnectionString()
cn = New SqlConnection(dbcon)
the problem is that when i run this and look and see what it's going after,
it says this
Referenced object has a value of 'nothing'
So i tried this instead
Dim connectionStrings As ConnectionStringSettingsCollection =
WebConfigurationManager.ConnectionStrings
Dim connectionStringsEnum As IEnumerator =
connectionStrings.GetEnumerator()
this give me a little more info.. it responses
? connectionstrings.Item(0)
{System.Configuration.ConnectionStringSettings}
ConnectionString: "data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
Instance=true"
ElementInformation: {System.Configuration.ElementInformation}
LockAllAttributesExcept:
{System.Configuration.ConfigurationLockCollection}
LockAllElementsExcept:
{System.Configuration.ConfigurationLockCollection}
LockAttributes: {System.Configuration.ConfigurationLockCollection}
LockElements: {System.Configuration.ConfigurationLockCollection}
LockItem: False
Name: "LocalSqlServer"
ProviderName: "System.Data.SqlClient"
the connection string is not getting picked up.
So i look at the build order for this solution.
It's order is
1. silverlight
2. web site
3. web deployment
so if i'm reading this right, the web deployment shoudl be #1 so that it can
pick up the settings.
can someone help out and tell me where i've gone astray.
thanks
shannon