Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created an ASP.NET MVC 3 project in Visual Studio and the database is a SQL Server Express database BeerRecommenderContext.mdf with a log file BeerRecommenderContext.ldf. I can upload these to the standard App_Data directory but the connection string doesn't seem to work. I think it's because my host doesn't recognize the files as SQL Server files. My host, is using WebsitePanel. My current connection string is;Database=BeerRecommenderContext;UserID=timoteo1097;Password=●●●●●●●●

(of course the password is actually filled in properly)


share|improve this question

You can check with them, but it's highly unlikely this method of connection is supported by the host.

The preferred way of getting your database set up is to restore a backup (you can do this through WebsitePanel), and follow their instructions for connecting. A host will normally have example connection strings that you can copy/paste into your configuration file.

share|improve this answer

You could either upload your database to the App_data folder and use the AttachDBFilename attribute in your connection string to connect. See this

Or I would recommend to script out the database you have on your development machine to a newly created database on WebsitePanel and use the connection string you have above on your web.config. To script out the DB you can right-click database > tasks > Generate scripts. You can script the schema and/or data. Once you have this scripted to a SQL file, use SSMS to connect to and run it against your database.

share|improve this answer

Does you hosting provider have SQL Server installed on your web server, or is it installed on another server? It's probably installed on another server. You'll need to have their support group move the database to the SQL Server and attach the database, which they probably won't do as it's a security risk. They'll probably give you a portal which you can use which will allow you to run the needed SQL Scripts to create all the objects.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.