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

编程入门 行业动态 更新时间:2024-10-22 23:00:19
本文介绍了我们如何在应用程序配置文件中创建连接字符串????的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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();

更多推荐

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

本文发布于:2023-11-15 23:53:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1599090.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   配置文件   应用程序   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!