微软企业库 默认创建的Database方法 .提供的配置连接等.webform是在web.config里面.

winform是在app.config里面..但是 在windows是服务中.用不了配置文件.或着在一定条件下想自定义 连接字符串..

方法:

  using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

  SqlDatabase _database =new SqlDatabase("Connectionstring")    //new SqlDatabase("server=VSVT-DEV02 ;database=VSVT ;uid=sa ;pwd=aa ;");
  return _database;

相关文章:

  • 2022-01-23
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2022-12-23
  • 2021-11-18
  • 2022-01-26
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
相关资源
相似解决方案