How to use an mdf file database?

Discussion in 'Databases' started by Anse, May 14, 2014.

  1. Hi,

    I have developed my site in Visual Studion 2012 using MVC 4, Entity Framework and some other stuff. However the site is working fine locally on my development environment.

    When I publish the site, including the mdf file database which I have created in Visual Studio, something goes wrong. Is there some setting or something that needs to be adjusted?

    here is the connectionstring:

    <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-XXX.XXX-20140302023013;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-XXX.XXX-20140302023013.mdf" providerName="System.Data.SqlClient" />
    </connectionStrings>
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    I assume this is a SQL Server Express database and not Microsoft Access? I'm afraid SQL Server Express databases are not supported in production environments.
     
  3. Oh shoot! Its cuz I have used the Simple Membership Provider aswell. However if I use MS SQL Server 2012 and detach the mdf file, will that do the trick?
     
  4. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    Yeah, if you detach the database, re-attach it through the Control Panel and update the connection string, it should work. Make sure you've purchased the MS SQL Server 2012 add-on service though.
     
    martino likes this.

Share This Page