很多时候,我们都需要从配置文件中读取数据库连接自符串,但是 ORDesigner 生成 DataContext 的初始化函数是写死的。

public MyDataContext(ALinq.Mapping.MappingSource mappingSource) :
base("data source=C:\\Northwind.db", mappingSource)
{
OnCreated();
}

 

 

其实我们只要设置一下就行了,就不会生成上面的初始化函数了。将 Application Settings 由 false 改为 true 。

[ORDesigner] 自定义数据库连接自符串

相关文章:

  • 2021-06-08
  • 2022-12-23
  • 2021-11-18
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2022-01-09
  • 2021-12-28
  • 2022-02-27
  • 2022-12-23
相关资源
相似解决方案