T
TR
I'm having a little trouble developing a test webservice; the web.config
file is not being handled the way I expected, based on previous
experience with webforms apps.
In my webforms apps, I've been putting the SQL connection string in the
web.config
file:
<configuration>
<appSettings>
<add key="ConnectionString" value="Data Source=myhost\myserver;Initial
Catalog=DB1;User Id=SQLUSER100;Password=mypassword;"/>
</appSettings>
<system.web>
</system.web>
</configuration>
And then, in my webform class, a property encapsulates this particular
appSetting:
Private ReadOnly Property ConnectionString() As String
Get
Return ConfigurationSettings.AppSettings("ConnectionString")
End Get
End Property
When I try to do the same with the webservice I'm experimenting with,
the property is causes this error:
"Name 'ConfigurationSettings' is not declared."
Is the web.config file not applicable for webservices? If so, what is
the best way to store and supply the connectionstring?
Thanks
TR
file is not being handled the way I expected, based on previous
experience with webforms apps.
In my webforms apps, I've been putting the SQL connection string in the
web.config
file:
<configuration>
<appSettings>
<add key="ConnectionString" value="Data Source=myhost\myserver;Initial
Catalog=DB1;User Id=SQLUSER100;Password=mypassword;"/>
</appSettings>
<system.web>
</system.web>
</configuration>
And then, in my webform class, a property encapsulates this particular
appSetting:
Private ReadOnly Property ConnectionString() As String
Get
Return ConfigurationSettings.AppSettings("ConnectionString")
End Get
End Property
When I try to do the same with the webservice I'm experimenting with,
the property is causes this error:
"Name 'ConfigurationSettings' is not declared."
Is the web.config file not applicable for webservices? If so, what is
the best way to store and supply the connectionstring?
Thanks
TR