Add a connection in Server Explorer
Add new connections
The steps in this article show how to connect to a database in the Visual Studio IDE. You can use these steps to work directly with your data, such as execute queries, edit data, create and edit tables and other schema properties, edit stored procedures and functions, triggers, and so on. These functions are independent of the programming language or .NET version you are using.
You can test your connection to a database or service, and explore database contents and schemas, by using Server Explorer or SQL Server Object Explorer. The functionality of these windows overlaps to some extent. The basic differences are:
-
Server Explorer
Installed by default in Visual Studio. Can be used to test connections and view SQL Server databases, any other databases that have an ADO.NET provider installed, and some Azure services. Also shows low-level objects such as system performance counters, event logs, and message queues. If a data source has no ADO.NET provider, it won't show up here, but you can still use it from Visual Studio by connecting programmatically.
-
SQL Server Object Explorer
Installed with SQL Server Data Tools and visible under the View menu. If you don't see it there, go to Programs and Features in Control Panel, find Visual Studio, and then select Change to re-run the installer after selecting the check box for SQL Server Data Tools. Use SQL Server Object Explorer to view SQL databases (if they have an ADO.NET provider), create new databases, modify schemas, create stored procedures, retrieve connection strings, view the data, and more. SQL databases that have no ADO.NET provider installed won't show up here, but you can still connect to them programmatically.
Add a connection in Server Explorer
To create a connection to the database, click the Add Connection icon in Server Explorer, or right-click in Server Explorer on the Data Connections node and select Add Connection. From here, you can also connect to a database on another server, a SharePoint service, or an Azure service.
Connect using SQL Server Object Explorer
The experience might be easier if you use SQL Server Object Explorer, which gives you a dialog that provides more help in finding available databases locally, on the local network, and in your Azure subscriptions, and provides a history of recently used choices.
To access the connect dialog from SQL Server Object Explorer, click the toolbar button Add SQL Server.
相关文章
- SQL Server-聚焦IN VS EXISTS VS JOIN性能分析(十九)
- Sql server在另一台服务器,在Visual Studio 中没问题,IIS中 提示“在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。。。。”
- Get first day of week in SQL Server
- Escape Character in SQL Server
- Execution Plans in SQL Server
- Can't connect to localhost, but can with computer name in SQL Server 2008
- SQL Server loop - how do I loop through a set of records
- 报错:MySQL Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
- SQL Server游标 C# DataTable.Select() 筛选数据 什么是SQL游标? SQL Server数据类型转换方法 LinQ是什么? SQL Server 分页方法汇总
- SQL Server查询优化
- Canal Server+Canal Admin
- Play Framework, Server Sent Events and Internet Explorer
- sql server 小技巧(3) SQL Server 2012 数据库完整导出到SQL Azure (包括数据)
- Sql Server 2012 分页方法分析(offset and fetch)
- (4.31)sql server中的xml数据操作
- sql server误删数据恢复delete(低效版)
- (4.26)sql server存储过程优化
- 【生产问题】sql server还原一个很小的BAK文件,但却花了很长时间,分析过程
- 【MySql 】is not allowed to connect to this MySql server 无法访问远程MySQL数据库
- zabbix 简介和 zabbix-server、zabbix-agent安装