我们如何在应用程序配置文件中创建连接字符串???? [英] How we can make connection string in application configration file?????

查看:59
本文介绍了我们如何在应用程序配置文件中创建连接字符串????的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在应用程序配置文件中创建连接字符串????

How we can make connection string in application configration file?????

推荐答案

您的名字让我想起了harold和kumar:P

您只需像添加其他任何字符串一样添加它,然后像读取其他任何字符串一样读取它即可.您在网上找到的用于使用配置文件的任何示例都将适用于您的连接字符串.
your name reminds me of harold and kumar :P

You just add it, like any other string, and read it just like any other string. Any sample you find online for using the config file, will work for your connnection string.


我建​​议您进行谷歌搜索:)
I suggest that you should do googling :)


Define your connection string in web.config file as:
<connectionStrings>
    <add name="connString" connectionString="...." />
</connectionStrings></pre>

And use it as follows:
<pre lang="C#">ConfigurationManager.ConnectionStrings["connString"].ToString();


这篇关于我们如何在应用程序配置文件中创建连接字符串????的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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