Database does not work on remote site

Last post 11-11-2009 9:49 PM by Thomas Sun – MSFT. 2 replies.

Sort Posts:

  • Database does not work on remote site

    11-08-2009, 2:15 AM
    • Member
      point Member
    • ben21293
    • Member since 11-08-2009, 6:57 AM
    • Posts 1

    I created an asp.net app that uses a database and it works fine locally, however, I am not sure how to access the database once it has been uploaded to my web site.  The company that hosts my site is ix web hosting.  My connection string before I uploaded the web site is

      connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SM.mdf;Integrated Security=True;User Instance=True"

    Can someone please help me edit my connection string so I can access my database and make any other necessary adjustments?

     

  • Re: Database does not work on remote site

    11-08-2009, 3:05 AM
    Answer

    Does your web hosting company support Sql Server Express?  Have you asked them for guidance? Do they provide a FAQ for this kind of thing?


    Regards Mike
    [MVP - ASP/ASP.NET]
    My site    Please help - URGENT!!!    What ASP.NET can and can't do
  • Re: Database does not work on remote site

    11-11-2009, 9:49 PM
    Answer

    Hi,

    I think it depends upon which SQL Server Edition of host server is using. If it is SQL Server Express version, we can upload your express database, such as aspnetdb.mdf file (which is in the app_data folder) to server directly.

    If it is SQL Server 2005, we can either use aspnet_regsql utility to recreate database on server and import data, or use your existed database to create .SQL Installation Scripts and then use this .SQL files to create Database on Server.

    Besides, please don't forget to modify connection to point to new database in web.config.
    For more information, see (Deploying a SQL Database to a Remote Hosting Environment) http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx
     

     
    I look forward to receiving your test results.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (3 items)