2

If I create a website that uses an mdf in App_Data with the connection string:

Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;

what do I need to do to run the site in a shared hosting environment? Do I need to copy the contents of my mdf to the main SQL Server engine of my host? Is there a way to use the non-SQLExpress engine of my host and still keep my mdf in my App_Data?

sorin
  • 161,544
  • 178
  • 535
  • 806

2 Answers2

2

Your webhost should have documentation on this. Gearhost.com is my webhost, and they do.

If your webhost doesn't have documentation on this, email them and then find a new webhost.

George Stocker
  • 57,289
  • 29
  • 176
  • 237
2

Mdf files will only work with SQL Server engines (Express or the full versions). The provider you use will need to provide access to a SQL Server engine. As Gortok said, a lot depends on the provider. See their documentation for the details.

Matt Spradley
  • 7,854
  • 9
  • 31
  • 40