如何加载数据库独立的SQL SERVER和WEB SERVER [英] How do I load database independent SQL SERVER and WEB SERVER

查看:97
本文介绍了如何加载数据库独立的SQL SERVER和WEB SERVER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何创建一个自己加载数据库的项目?



例如,我有ASP .NET WEB FORMS项目或MVC,我用SQL MANAGEMENT STUDIO创建数据库,而不是在我项目的app_data文件夹中复制这个数据库。

然后我创建DataGrid我想要从app_data数据库加载DataGRID中的数据,而不是SQL SERVER。我可以消除SQL SERVER吗?

我必须更改连接字符串或我必须做什么才能使数据库独立于WWE SEVER和SQl服务器????

如果不是可能,如何使我的项目在另一台PC上本地创建数据库并从那里运行我的项目???



提前谢谢。

Hello everybody,

How to create an project that load a database from itself?

For example, I have ASP .NET WEB FORMS project or MVC and I create database with SQL MANAGEMENT STUDIO and than I copy this database in app_data folder of my project.
Then I create DataGrid and I want to load data in DataGRID from app_data database,not SQL SERVER . Can I eliminate SQL SERVER?
Must I change connection string or what must I do to make a database independent fromWEB SEVER and SQl Server????
If it is not possible, how to make my project create database locally on another PC and run from there my project???

Thanks in advance.

推荐答案

嗯......是的......理论上你可以直接使用数据库。但是......这是一个非常愚蠢的想法。



网站本质上是多用户,直接访问文件(这意味着将其视为JET或ACE数据库)意味着你失去了SQL服务器的优势:多用户访问。而且,当涉及多个用户时,我曾经处理过的直接访问数据库的每个系统都存在严重的间歇性问题。你可以围绕它们工作,但它很笨拙,很慢,你必须记住每次尝试使用数据库时都要这样做。



我会使用SQL服务器 - Express版本可能会这样做 - 并且为自己节省了很多问题。
Um...yes...in theory you can use the database directly. But...it's a very silly idea.

Web sites are intrinsically multi user, and directly accessing the file (which means treating it as a JET or ACE db) means that you lose the advantage of SQL server: multi user access. And every system I've ever worked on which accessed databases directly has had major intermittent problems when multiple users are involved. You can work round them, but it's clumsy, slow, and you have to remember to do it every single time you try to use the DB.

I would use SQL Server - the Express version will probably do - and save myself a lot of problems.


正如已经指出的那样,我也相信使用Sql Server会对你的应用程序带来好处。创建数据库但没有使用数据库管理系统没有任何意义。



另外一个观点是,如果你以后开始对网络进行负载平衡您需要将数据层正确放置在单独的服务器上的服务器。在不同的Web服务器上安装两个完全隔离的数据库文件会导致严重的问题。
As already pointed out I also believe that using Sql Server would be a benefit in your application. It doesn't make any sense to create a database but not use the database management system.

On additional point of view is that if you later start load balancing the web servers you need to place the data-tier properly on a separate server. Having two completely isolated database files on separate web servers would cause a serious problem.


这篇关于如何加载数据库独立的SQL SERVER和WEB SERVER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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