none
After Deploy/Publishing WCF server doesn't work-help RRS feed

  • Question

  • I have a WCF service that when I check in the WCF Test Client it works fine but after I deployed the service to a remote server(my college server) It doesn't work . I ran it on a wp8 app but it didn't gave me the errors so I ran it on the wcf test client and I found out that I cant connect to my DB and I don't know why !

    I search all over the web about connection strings because everyone told me that it is probably this but every thing seem fine :(

    this is my connection string:

    <connectionStrings>
    <add name="dbPulpoConnectionString" providerName="System.Data.SqlClient" connectionString="Server=(LocalDb)\v11.0;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\PulpoDatabase.mdf"/>

    I changed it also to :

     <connectionStrings>
    <add name="dbPulpoConnectionString" providerName="System.Data.SqlClient" connectionString="Server=.\SQLEXPRESS;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\PulpoDatabase.mdf"/>

    but it still didnt work><

    edit: In my propretise it says .NET FRAMWORK 4.5

    please please help me I dont know what to do anymore><

    edit: I have all the Permissions I need On the remote server , on the remote server I have App_Data folder that my database.mdf files are in there and web.config and bin and the wcf.svc server



    Monday, May 20, 2013 5:57 PM

Answers

  • On 5/21/2013 12:15 PM, shirhen_ince wrote:

    yes the WCF Web service has the code that is going to access the database...

    so If mdf is not what I need then what is?

    I checked the URL but I cant figure out what to do , do I need to do a new DB and if not how I change the one I have



    I'm so confused...

    You need to install SQL Server Express on the server machine and Attach the database to the database engine. You can then have multiple users use the database, because the database will not be a single user instance when attached to SQL Server.

    You should move the mdf file to SQL Server Data folder where all the other database files are located and Attach the database file.

    Tuesday, May 21, 2013 5:15 PM

All replies

  • On 5/20/2013 1:57 PM, shirhen_ince wrote:

    I have a WCF service that when I check in the WCF Test Client it works fine but after I deployed the service to a remote server(my college server) It doesn't work . I ran it on a wp8 app but it didn't gave me the errors so I ran it on the wcf test client and I found out that I cant connect to my DB and I don't know why !

    I search all over the web about connection strings because everyone told me that it is probably this but every thing seem fine :(

    The connectionstring has to be in the right config file. And if it is not, then .NET can't find it.

    Monday, May 20, 2013 11:01 PM
  • it is on the web.config file 

    HOW CAN I KNOW IF .NET CAN FIND IT OR NOT? 

    do I need to add here the web.config file ? 

    Tuesday, May 21, 2013 8:14 AM
  • On 5/21/2013 4:14 AM, shirhen_ince wrote:

    it is on the web.config file

    HOW CAN I KNOW IF .NET CAN FIND IT OR NOT?

    do I need to add here the web.config file ?

    So, this WCF Web Service has the code that is going to access the database? If the WCF Web service is the project that is logging onto the database, then the connectionstring should be in the Web.config of the WCF Web service. If that's not what is happening, then the connectionstring has to be moved to a config file of the WCF client application.
     Also take note on this, the MDF user instance shouldn't be used not for a Web wpplication since it is a multiple users application, and only one user can have a MDF file open at any give time.

    http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/preparing-databases

    Tuesday, May 21, 2013 11:10 AM
  • yes the WCF Web service has the code that is going to access the database... 

    so If mdf is not what I need then what is? 

    I checked the URL but I cant figure out what to do , do I need to do a new DB and if not how I change the one I have 

    I'm so confused...

    Tuesday, May 21, 2013 4:15 PM
  • On 5/21/2013 12:15 PM, shirhen_ince wrote:

    yes the WCF Web service has the code that is going to access the database...

    so If mdf is not what I need then what is?

    I checked the URL but I cant figure out what to do , do I need to do a new DB and if not how I change the one I have



    I'm so confused...

    You need to install SQL Server Express on the server machine and Attach the database to the database engine. You can then have multiple users use the database, because the database will not be a single user instance when attached to SQL Server.

    You should move the mdf file to SQL Server Data folder where all the other database files are located and Attach the database file.

    Tuesday, May 21, 2013 5:15 PM