简体   繁体   English

如何查询我在Visual Studio的SQL Server中附加的mdf文件?

[英]How to query against a mdf file I attached in SQL Server in Visual Studio?

Hell all, 地狱所有人

I just attached a mdf file in SQL Server 2008, and everything is working correctly. 我只是在SQL Server 2008中附加了mdf文件,并且一切正常。 Now I want to open visual studio, and query against the mdf file I just attached, is there a local version of the connection string that needs to go in to web.config? 现在,我想打开Visual Studio,并查询刚刚附加的mdf文件,是否需要将本地版本的连接字符串输入到web.config中?

If I leave SQL Server open will it act as an instance of the database while I am working on the site in Visual Studio? 如果我在SQL Server中打开网站,则在SQL Server处于打开状态时,它将充当数据库的实例吗? Or am I suppose to run it somehow? 还是我想以某种方式运行它?

Any info would be appreciated, thanks! 任何信息将不胜感激,谢谢!

Just use Data Source=(local) to connect to the local instance of SQL. 只需使用Data Source =(local)连接到SQL的本地实例即可。

On a separate note, if it is a small app, consider using SQL Compact instead. 另外,如果它是一个小型应用程序,请考虑使用SQL Compact。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio中添加SQL Server数据库文件(.mdf)而不安装SQL Server Express Edition? - How to add SQL Server database file (.mdf) in Visual Studio without installing SQL Server Express Edition? 将Visual Studio设置为创建SQL Server 2005支持的mdf文件 - Set Visual Studio to create mdf file that SQL Server 2005 supports 如何使用本地 mdf 文件在 Visual Studio 中建立 SQL 连接 - How to establish SQL Connection in Visual Studio using local mdf file 如何在 Visual Studio 2019 中添加 .mdf 文件? - How to add .mdf file in Visual Studio 2019? 如何在没有Management Studio的情况下将数据库mdf文件附加到SQL Server Express? - How to attach database mdf file to SQL Server Express without Management Studio? 如何在 Visual Studio 2012 中访问已发布的 .mdf 数据库文件 - How to access published .mdf database file in Visual Studio 2012 如何加密MS SQL附加的mdf文件(用户实例SQL Express) - How to encrypt MS SQL attached mdf file (user instance SQL Express) 我无法在Visual Studio 2008中打开mdf文件-像txt文件一样打开文件,而在Managament Studio中则无法打开 - I can't open mdf file in Visual Studio 2008 - file open like txt file and not in managament studio 无法通过应用程序,SQL Server Management Studio或VS Server资源管理器访问SQL Server MDF文件 - Cannot access SQL Server MDF file through app, SQL Server Management Studio, or VS Server explorer 如何在简单的 Web 项目中连接到 .mdf(Microsoft SQL Server 数据库文件)? - How do I connect to an .mdf (Microsoft SQL Server Database File) in a simple web project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM