Stupid me I uploaded Local SQL Connection string to DASP Web site How can I fix

Discussion in 'General troubleshooting' started by albanello, Oct 14, 2007.

  1. Please Help

    I have done a very STUPID thing.

    Using Visual Studio's "COPY PROJECT" I uploaded a newer version of my site. This newer version had my LOCAL SQL connection string in the code. I tried to redo the upload, using "COPY PROJECT" again , the site with the correct DASP SQL connection string and "COPY PROJECT" does not seem to be able to connect to my DASP site. As a result I am unable to upload the correct Code with the correct DASP SQL Connection string. I have tried, in DASP Control Panel, STOPPING, STARTING and RECYCLING the Site, with no success.
    Can you please tell me how I can upload the correct web site application code containing the correct DASP SQL Connection String ?[​IMG] Please Help
    Thanks
    Albanello
     
  2. Bruce

    Bruce DiscountASP.NET Staff

  3. Bruce

    Thank you for your response.

    I'm sorry I did not respond sooner. I've been out of town for work, I should be home tonight and will try your suggested fix.

    I'll be sure to let you know the result.

    Thanks again
    albanello
     
  4. Bruce

    I just FTP'ed the .dll file that was rebuilt with the correct DASP SQL connection string. The Site is up and running again THANKs.

    Could you please answer a couple more questions for me:
    1) Is there a way the application can tell where it is runnung DASP or Local so it can determine the correct DASP SQL string to use?
    2) Was my assumption correct that the incorrect DASP SQL Connection string was the reason I could not connect to the WEB server to try and redo Copy Project ?
    3) Will the Copy Project work again ?(I'm afraid to try it right now) or would you recommend not using Copy Project and do all my uploads via FTP.

    Thanks again
    albanello
     
  5. 1) Is there a way the application can tell where it is running DASP or Local so it can determine the correct DASP SQL string to use?

    Not quite sure what you mean by this, but if you are trying to connect to our sql database the connection string should be the same whether it is running on your local machine or our hosting server. The database is separate from the web server so any outside source provided that it is passing the correct db server name, db name, and login credentials should be able to connect to the database.

    2) Was my assumption correct that the incorrect DASP SQL Connection string was the reason I could not connect to the WEB server to try and redo Copy Project ?

    No. The SQL connection string is completely separate from how your computer connects to our web server. Not sure why your VS 2005 couldn't connect. It sounds like some kind of network connectivity issue. Maybe a firewall?

    3) Will the Copy Project work again ? (I'm afraid to try it right now) or would you recommend not using Copy Project and do all my uploads via FTP.

    Copy Project requires that FrontPage Server Extensions be enabled on your account. I advise staying away from FrontPage Server extensions since it has been known to skew ntfs permissions on the server. I suggest sticking with FTP. Much cleaner way of uploading. Besides Microsoft is trying to retire FrontPage Server extensions.

    rcp
    DiscountASP.NET
    www.DiscountASP.NET
     
  6. rcp [DASP]
    Thank you for your response.



    rcp[DASP]> "Not quite sure what you mean by this,.........."


    albanello> I have a local version of MS SQL DB I use for development that my local Visual Studio ASP.NET works with. So the local version of MS SQL DB has a different connection string then the DASP MS SQL DB connection string. I comment out the connection string to my local MS SQL DB and Uncomment out the DASP MS SQL DB connection string when I do a COPY PROJECT to DASP.
    A) Could I maybe try to connect using the local connection string and if it throws a exception try to connect with the DASP connection string ?



    rcp[DASP]> "No. The SQL connection string is completely separate........"


    albanello> I am using VS 2003 and have been doing COPY PROJECT to DASP for 3 years now. The day this problem started I had just completed a COPY PROJECT with no problem then I realized I didn't change to the DASPM MS SQL DB connection string. When I tried to do another COPY PROJECT it would not work. That is why I thought the incorrect connection string, in my web application at DASP, was causing the problem.



    rcp[DASP]> "Copy Project requires that FrontPage Server Extensions be........."


    albanello> OK I will start doing uploads using FTP.
    B) Should I disable Front page extension at DASP
    C) Can you recommend a FTP program that will remember what files to upload. I used IE and it was a real pain to go through my project and pick out all the ".aspx", ".css", ".config" and ".dll" files. I would like to find something that remembered what to upload or figures out, by date, what needed to be updated.


    Thanks again
    albanello
     
  7. Bruce

    Bruce DiscountASP.NET Staff

    1) ASP.NET or IIS doesn't have any native ability to determine if the connection string is valid or not. You can certainly do something programatically like read the server name and if server name = your local computer, use this connection string. I don't think this is a good idea though.

    Since all your connection strings is within the web.config file, you may as well keep a development copy of the web.config and a production copy.

    2) Was my assumption correct that the incorrect DASP SQL Connection string was the reason I could not connect to the WEB server to try and redo Copy Project ?

    That we can't really tell.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. Bruce


    Thank you for your response. I will look into maintaning two copies of the Web.config file.


    albanello
     

Share This Page