Visual Studio 2010 .mdf

Discussion in 'Databases' started by Brylexion, Sep 5, 2011.

  1. Good Morning;

    I have a question about your databases uploads and I believe that I have found the answer on one of your forum pages. However I wanted to get absolute confirmation from your staff.

    I am currently making a website using Visual Studio 2010. Within the website I created a database that has the extension .mdf. I attempted to upload my website through my Visual Studio program. Of this I had no problems; however, when I attempted to run my website off the web an error came back stating that the connection string was empty. Through hours of trial & error, I discovered that I did not build my database using sql server 2008, which I do not own, nor did I build my database using Microsoft Access, so neither command for the LocalSqlServer nor the code for the script tag was going to work. I therefore found a post on one of your forums page regarding .mdb extensions and how Winhost does not support this extension type and so now I am assuming the like can be said about the .mdf extension. Can someone please answer this for me?
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    The .mdb extension usually refers to a Microsoft Access file. You can deploy this database by uploading it to your site account using FTP. The .mdf extension usually refers to a Microsoft SQL Server file. Since you are using Visual Studio 2010, it is creating a SQL Server Express database (free version). You can deploy this database by creating a SQL Server 2008/2008 R2 database through your Control Panel and restore/attach it using the tools in your Control Panel. When you create the database, you will also be provided a connection string. This is the connection string you need to use in your application.

    For more information on publishing your SQL Server database, please see this knowledgebase article:

    http://support.Winhost.com/KB/a694/publishing-your-sql-2008-database-to-Winhost-sql-2008-server.aspx

    This link provides sample code which you can refer to when connecting your application to your database:

    http://support.Winhost.com/KB/c263/sample-code.aspx

    This site has information regarding connection strings:

    http://www.connectionstrings.com/
     
    Last edited by a moderator: Oct 14, 2015
  3. Thank you for your reply.

    I do have another question though. As per your reply, regarding the restore/attach" tool. I have successfully restore my database using the Winhost restore tool, but the attach tool requires an upgrade to the ultimate plan. Is this correct and if so how do I go about upgrading my plan.
     
    Last edited by a moderator: Oct 14, 2015
  4. Elshadriel

    Elshadriel Winhost Staff

    You can change your hosting plan through your Control Panel -> Sites -> Manage. There is a button called Change Plan under the Site Info section.
     

Share This Page