Home > Database > Mysql Tutorial > 使用VS 2005 和SQL Server 2005创建连接(2)_MySQL

使用VS 2005 和SQL Server 2005创建连接(2)_MySQL

WBOY
Release: 2016-06-01 13:50:35
Original
1008 people have browsed it

SQLServer2005

bitsCN.com

    在应用程序中的web.config文件添加如下数据库连接的配置:


      

connectionString="Data Source=       
.SQLEXPRESS;Initial Catalog=Northwind;  
User ID=sa;Password= sapassSql" providerName="System.Data.SqlClient"/>


至此,我们就可以在Visual Studio 2005中调用SQL Server的数据连接了。


最后,我们来测试数据连接,首先打开Visual Studio 2005,在视图的“服务器资源管理器”来添加SQL server 2005的连接,通过输入服务器名称和对应的SQL Server身份验证的sa用户名密码后,选取对应的数据库,最后点击“测试连接”,即可成功连接到数据库了。

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template