August 22nd, 2003, 05:41 AM
Change db connection string in web services
I am new to .NET and currently need some help in developing a web service. The connection string inside the web service is fixed but leave the database server name blank. When the client call the web methods from the web service, I need to pass the database server name into the web service. I had tried to use constructor (sub new) and class property inside the web service class but failed. And I cannot store the connection string inside the web.config file. Is there any way to pass in a global yet dynamic value/property into the XML web service?
The following is the example fo my connection string:
Public Function sGetConnectionString() As String
sGetConnectionString = "User ID=sa;Data Source=" & msServerName & ";Tag with column collation when possible=False;Initial Catalog=test;Use Procedure for Prepare=1;Auto Translate=True;Persist Security Info=False;Provider=""SQLOLEDB.1"";Workstation ID=PAMMY"
Your help is highly appreciated
October 22nd, 2003, 08:44 PM
I too am having problems overloading the constructior of a web service. How are you other guys keeping your connection strings from your web services dynamic?