Using a .MDF SQL Server Database with ASP.NET Versus Using SQL Server
Posted
by Maxim Z.
on Stack Overflow
See other posts from Stack Overflow
or by Maxim Z.
Published on 2010-04-13T17:21:29Z
Indexed on
2010/04/13
17:53 UTC
Read the original article
Hit count: 457
I'm currently writing a website in ASP.NET MVC, and my database (which doesn't have any data in it yet, it only has the correct tables) uses SQL Server 2008, which I have installed on my development machine. I connect to the database out of my application by using the Server Explorer, followed by LINQ to SQL mapping.
Once I finish developing the site, I will move it over to my hosting service, which is a virtual hosting plan. I'm concerned about whether using the SQL Server setup that is currently working on my development machine will be hard to do on the production server, as I'll have to import all the database tables through the hosting control panel.
I've noticed that it is possible to create a SQL Server database from inside Visual Studio. It is then stored in the App_Data directory.
My questions are the following:
- Does it make sense to move my SQL Server DB out of SQL Server and into the App_Data directory as an
.mdf
file? - If so, how can I move it? I believe this is called the
Detach
command, is it not? - Are there any performance/security issues that can occur with a
.mdf
file like this? - Would my intended setup work OK with a typical virtual hosting plan? I'm hoping that the
.mdf
database won't count against the limited number of SQL Server databases that can be created with my plan.
I hope this question isn't too broad. Thanks in advance!
Note: I'm just starting out with ASP.NET MVC and all this, so I might be completely misunderstanding how this is supposed to work.
© Stack Overflow or respective owner