zoukankan      html  css  js  c++  java
  • 使用app.config中的数据对数据库链接信息初始化

    看到别人数据库信息都是在app.config里面设置的,今天来尝试了一下,报了

    "System.Configuration.ConfigurationSettings.AppSettings"已过期:"this method has obsolete,it has been repalced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings"

    的警告,上网查了一下,得知需要在 引用  中添加引用选System.Configuration,然后确定,再在类上写  using System.Configuration;

    接着把System.Configuration.ConfigurationSettings.AppSettings改成System.Configuration.ConfigurationManager.AppSettings

    然后就没有报警告了。

  • 相关阅读:
    11.MySQL
    10、设计模式
    9
    8
    7
    6
    5
    4
    3
    2
  • 原文地址:https://www.cnblogs.com/cellphoneyeah/p/5411682.html
Copyright © 2011-2022 走看看