Take the 2-minute tour ×
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. It's 100% free, no registration required.

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, dotnet-host.com is using WebsitePanel. My current connection string is

Server=mssql0921.dotnet-host.com;Database=BeerRecommenderContext;UserID=timoteo1097;Password=●●●●●●●●

(of course the password is actually filled in properly)

The

share|improve this question
add comment

3 Answers

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
add comment

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 mssql0921.dotnet-host.com and run it against your database.

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.