Leo108's Blog
  • 首页
  • 版权声明
  • 联系我

web.config

A collection of 1 post

web.config

C#.net读取web.config中数据库链接字符串

在VS中配置好数据链接之后,会在web.config文件中加入数据库连接字符串。 写代码的时候需要进行数据库操作,就得用到数据库连接字符串。 string myConn = System.Configuration.ConfigurationManager.ConnectionStrings["sqlConnectionString"].ConnectionString; 其中的sqlConnectionString就是配置时的数据连接名。

  • Leo Chen
    Leo Chen
1 min read
Leo108's Blog © 2019
Latest Posts Ghost