#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    1
    Rep Power
    0

    Question Change db connection string in web services


    Hi there,
    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"
    End Function

    Your help is highly appreciated
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    1
    Rep Power
    0

    Angry


    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?

IMN logo majestic logo threadwatch logo seochat tools logo