不想在server2008对象资源管理器窗口中显示数据库 [英] To not want to show the database in server2008 object Explorer windows

查看:115
本文介绍了不想在server2008对象资源管理器窗口中显示数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有.mdf&我的项目目录文件夹中的.ldf文件.
我通过编程&连接了该.mdf文件.每当我打开SQL SERVER2008 Management Studio时,都会将此附件数据库显示到server2008对象资源管理器窗口的左窗格中.

我的编程代码如下:-
------------------

I have .mdf & .ldf file in my project directory folder.
I connected that .mdf file by the programming & shown this attachment Database into left pane of server2008 object Explorer windows whenever i open SQL SERVER2008 Management Studio.

My programming code is below:-
------------------

Dim con As SqlConnection = New SqlConnection()
con.ConnectionString = "Server=.\MSSQLSERVER2008;AttachDbFilename=|DataDirectory|Test.mdf;Database=TestDB;Trusted_Connection=yes"
con.Open()


但是我想通过编程连接时,此附件数据库将不会显示在server2008对象资源管理器窗口的左窗格中.

有可能吗?
请帮助我任何指示....


But I want to do that this attachment database will not show in left pane of the server2008 object Explorer windows when i connect by the programming...

Is it possible???
Please help me any instruction....

推荐答案

正在谈论什么??

如果将数据库附加到SQL Server实例,它将显示在SQL Server Manager Studio中,并且无法解决此问题.

好吧,除非您从SQL Server实例中分离数据库,否则它将使您的数据库无法使用,但会使Management Studio和您的应用程序无法使用.
What are talking about??

If you attach the database to the SQL Server instance, it WILL show up in SQL Server Manager Studio and there is no way around that.

Well, unless you DETACH the database from the SQL Server instance, in which case it''ll make your database unusable but Management Studio AND your application.


这篇关于不想在server2008对象资源管理器窗口中显示数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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