数据库连接问题 [英] DB Conncetion Problem

查看:65
本文介绍了数据库连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一点疑问,请在生产或开发阶段监视我的SQL Server数据库

我有一个Web应用程序ASP.net 4.0并与MS SQL Server 2008连接.该数据库位于App_data文件夹中.
当我运行发行版或调试或部署它并运行系统时.我无法通过Microsoft管理工具打开数据库.

我必须完全关闭VS2010或重新启动mashine,

我的意思是,当我编写代码时,我必须完全关闭管理工具.当我要从管理工具中选择一些数据或进行数据库更改时,我必须完全关闭VS2010.这让我感到紧张.因为当我忘记了这一点时.我必须放下数据库并重新附加它.

这意味着通过asp.net应用程序和全球300个用户?如何管理或监视?

还有其他一些东西:我从Studio管理器创建了数据库,然后通常通过Web App连接到它.但是该数据库没有出现在App_Data文件夹中.在这种情况下,我可以从Studio管理器中打开数据库并打开Web应用程序同时监控SQL管理工具中的数据库事务

[edit]删除了虚假代码块-OriginalGriff [/edit]

Hi ALL

i have litte Question please , i need to monitor my SQL Server DB while production or development phase

i have a Web application ASP.net 4.0 and connected with MS SQL Server 2008 .The DB is in App_data folder .

when i run the release version or debug or deploy it and runs the system .i can’t open the Databse from Microsoft Management Tool .

i habe to close VS2010 completly or restart the mashine ,

i mean when i write code i must close the Management Tool completly .when i want to select some data from management tool or make DB Changes , i have to close VS 2010 completly .it makes me nervous .because when i forget that . i have to drop the DB and reattach it again .

that means by asp.net application and 300 users worldwide ?? how will be that managed or monitored ?

and also something else : i created the DB from Studio manager and then connected to it normally from the Web App .but the DB doesn’t appear in App_Data folder .in this case i can open the database from studio manager and open the web app at the same time and monitor the DB Transactions from SQL Management Tool

[edit]Spurious code block removed - OriginalGriff[/edit]

推荐答案

我相信您正在使用SQL Server Express Edition.使用SQL Server Management Studio打开数据库,使用VS打开ASP.NET App.如果我答对了,那么它将解决您的问题.
I believe you are using SQL Server Express Edition. Use SQL Server Management Studio for opening the database and VS for opening the ASP.NET App. If I''ve got you right then it will solve your problem.


这就是我要回答的问题,我会尽快尝试

您是否偶然为该应用程序创建了数据库文件"?

如果我没记错的话,Visual Studio有一种使用数据库的方法,可以在其中创建新的数据库文件,并在应用程序加载或卸载时使用分离/附加.

在我看来,这是使用数据库的一种糟糕方法,并且可能引起诸如您遇到的问题之类的问题.

检查是否存在这种情况,然后建议您修改该配置并改为使用与永久数据库的连接.
This is what i got for answer ,i will try it soon

Did you happen to create a "database file" for the application?

If I''m not mistaken, Visual Studio has a method of working with databases where it creates a new database file, and uses detach/attach when the application loads or unloads.

In my opinion this is a terrible way to work with a database and can cause problems such as what you experienced.

Check if this is the case and if it is, then I''d suggest you modify that configuration and use a connection to a permanent database instead.


这篇关于数据库连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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