ASP.net如何连接SQL SERVER 2012数据库
作者:小白桃要去远方 时间:2024-01-24 12:34:53
在web.config文件中添加
<connectionStrings>
<add name="SQLConnectionString" connectionString="Data Source=服务器名;Initial Catalog=数据库名;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
然后在需要连接数据库的页面中添加
//获取数据库连接字符串
public static string connString = ConfigurationManager.ConnectionStrings["SQLConnectionString"].ConnectionString;
以上所述是小编给大家介绍的ASP.net连接SQL SERVER 2012数据库的方法网站的支持!
来源:http://www.cnblogs.com/z-s-q/archive/2016/08/02/5728511.html
标签:asp.net,连接,sql
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
基于bootstrap风格的弹框插件
2024-05-02 17:32:29
python对象销毁实例(垃圾回收)
2022-07-29 06:22:14
vue多次循环操作示例
2024-05-28 15:48:20
![](https://img.aspxhome.com/file/2023/2/123162_0s.png)
Python深入学习之装饰器
2021-09-25 15:00:38
Mysql免安装版设置密码教程详解
2024-01-26 21:25:59
如何解决attachEvent函数时,this指向被绑定的元素的问题?
2024-04-28 09:33:29
Python3 适合初学者学习的银行账户登录系统实例
2021-06-16 05:09:22
Python实现随机取一个矩阵数组的某几行
2021-10-04 16:45:52
python cv2截取不规则区域图片实例
2022-08-31 18:58:42
![](https://img.aspxhome.com/file/2023/5/115105_0s.jpg)
关于多域名COOKIES作用域的问题
2008-11-18 16:12:00
Python安全获取域管理员权限几种方式操作示例
2022-10-04 01:14:15
![](https://img.aspxhome.com/file/2023/6/89236_0s.png)
浏览器tab的设计
2008-08-11 13:03:00
![](https://img.aspxhome.com/file/UploadPic/20088/11/200881113621228s.jpg)
如何使用五行Python代码轻松实现批量抠图
2023-10-06 08:05:20
![](https://img.aspxhome.com/file/2023/6/117576_0s.jpg)
MySQL百万级数据大分页查询优化的实现
2024-01-13 18:22:44
![](https://img.aspxhome.com/file/2023/5/124515_0s.png)
JavaScript中Promise处理异步的并行与串行
2024-04-28 09:47:12
![](https://img.aspxhome.com/file/2023/2/132772_0s.jpg)
vue+elementUI实现动态面包屑
2024-05-02 17:11:02
python中的 sorted()函数和sort()方法区别
2022-04-13 05:16:11
![](https://img.aspxhome.com/file/2023/1/121521_0s.png)
Python装饰器的两种使用心得
2023-03-17 17:03:23
textarea 在浏览器中固定大小和禁止拖动的实现方法
2024-04-19 10:17:41
如何捕获人家站点的页面?
2009-11-11 19:19:00