什么是VS连接到SQL Server App_Data文件夹内的数据库之间的区别? [英] What's the difference between the database inside App_Data folder vs connecting to SQL Server?

查看:233
本文介绍了什么是VS连接到SQL Server App_Data文件夹内的数据库之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的.NET和同时开始学习ASP .NET框架MVC2我看你能App_Data文件夹内创建一个.mdf文件并连接到它,或者您可以连接到SQL Server。

I'm new to .NET and while starting to learn ASP .NET MVC2 framework I see that you can create a .mdf file inside the App_Data folder and connect to it or you can connect to a SQL Server.

是如何与数据库交互的方法,这些区别?什么是一个比其他优势/劣势?

What is the difference between these to methods of interacting with a database? What are the advantages/disadvantages of one over the other?

推荐答案

在MDF在App_Data文件夹适用于网站和Web应用程序,它仅适用于SQL Server的防爆preSS(2005年,2008年, 2008 R2)。这是一个典型的与Visual Studio一起安装的版本,并作为开发环境正常工作。

The "MDF in the App_Data" folder works for web site and web apps, and it works only with SQL Server Express (2005, 2008, 2008 R2). This is the version that's typically installed along with Visual Studio, and which works fine as a dev environment.

SQL Server的防爆preSS对

SQL Server Express has a few limitations on


  • 使用的CPU数量(1)

  • 最大值。数据库(4 GB的2005/2008,10 GB 2008 R2)的大小

  • 最大值。使用的内存量(最大1 GB)

和多。这是一个伟大的和免费的方式来获得到SQL Server的发展。

and more. It's a great and free way to get into SQL Server development.

如果您需要制作水平的SQL Server,那么你可能会使用一个完整版本 - 网络,工作组,标准版,企业或任何的最高水平Datacenter版本的

If you need production level SQL Server, then you're probably going to use a full version - Web, Workgroup, Standard, Enterprise or any of the highest level DataCenter editions.

有一个pretty COM prehensive 比较的SQL Server 2008 R2版本页面了微软 - !去看看

There's a pretty comprehensive Compare SQL Server 2008 R2 Editions page up at Microsoft - go check it out!

编程经验应该是相同的,太 - 这真的只是一个ADO.NET连接字符串的问题(你是否需要有一个本地安装的SQL Server防爆preSS例如present)。

The programming experience should be identical, too - it's really just a question of the ADO.NET connection string (and whether or not you need to have a locally installed SQL Server Express instance present).

该数据库文件格式是完全相同的,所以你完全可以在您的App_Data文件夹一个.mdf文件,后来动了起来开始SQL Server的完整版 - 只需将您的MDF文件到您的服务器实例,现在使用该数​​据库。无缝协同工作。

The database file format is totally identical, so you can absolutely start with a .mdf file in your App_Data folder, and later move "up" to a full edition of SQL Server - simply attach your MDF file to your server instance, and now use that database. Works seamlessly.

这篇关于什么是VS连接到SQL Server App_Data文件夹内的数据库之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆