connecting to SQL server with mdf files

5 pts.
Tags:
.MDF files
SQL Server 2008
SQL Server 2008 R2
What is the best way to connect a website on a VPS to sql server 2008 R2 express, using MDF files as databases. The VPS is running on server 2008 R2. I installed the same environment on the development computer. IIS gets a connection because it sees the users that are in the ASPNETDB.MDF file. (Beside that I have another database.) But as soon as I run the website and try to log in, the application crashes. I tried using integrated security and user instance in the connectionstring in the webconfig file, but get the error that the user instance could not be created. I made a user in sql server but that user can only be linked to existing databases (so MASTER) and when logging in to the website i get the error that ASPNETDB.MDF could not be created in the MASTER database because that file already exist (so this would be completely wrong). So how can I connect it in the right way? I would rather keep on using MDF files in the App_Data directory of the website, but is that a good thing? Is it secure on the VPS?

Software/Hardware used:
see tags

Answer Wiki

Thanks. We'll let you know when a new response is added.

Storing the database in the App_Data directory usually isn’t the best idea. It wouldn’t be all that hard for someone to download the database from the website. Instead of having the AttachDbFilename parameter in there, simply attach the instance to the SQL Server and connect to it like a normal application would.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following