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

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

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

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

原文地址:https://www.cnblogs.com/ansiboy/p/1687591.html