如何在C#中建立连接以与Sql Server连接,当我们需要连接时,我使用该连接名称调用此连接 [英] How I Make A Connection In C# To Connect With Sql Server And When We Need Connection I Call This Connection With That Connect Name

查看:69
本文介绍了如何在C#中建立连接以与Sql Server连接,当我们需要连接时,我使用该连接名称调用此连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的c#

和你的宝贵回应可以帮助我提高我的技能c#

i将感谢全部你为你的这种善意

你的感觉Mian Sahib Jan

i am new with c#
and yours valuable response can help to me to improve my skill in c#
i will be thank full to you for yours this kindness
yours sensir Mian Sahib Jan

推荐答案

基本做法是将连接字符串添加到webconfig文件和使用系统的aceess代码中的.confurationmanager类。



网页配置



in section connectionstring



添加你的连接strig。



一旦你在你的代码中获得连接字符串就可以使用它来ping数据库。
basic practice is to add connection string to webconfig file and aceess that using system.confurationmanager class in your code.

in web config

in section connectionstring

add your connection strig.

once you get connection string in your code you can use it to ping database.


这篇关于如何在C#中建立连接以与Sql Server连接,当我们需要连接时,我使用该连接名称调用此连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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