|
我用 Linq to SQL 添加了一个User表 然后掉用的时候 没有 Connection 需要在Linq to SQL 里面添加点什么吗? 没分了,多多帮忙啊.
private InfDataContext InitializeInfDataContext_old(IsolationLevel isolationLevel)
{
var infDataContext = new InfDataContext(DB_CONNECTION_STRING);
if (infDataContext.Connection == ConnectionState.Closed)
{
infDataContext.Connection.Open();
infDataContext.Transaction = infDataContext.Connection.BeginTransaction(isolationLevel);
}
return infDataContext;
}
|
|
|
原来是我没添加引用 System.Data.Linq
|
|
| 20分 | |