Linq to SQL 连接问题

.Net技术 码拜 9年前 (2015-05-10) 1131次浏览 0个评论
 

我用 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分
http://blog.csdn.net/chinacsharper/article/details/9246623

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Linq to SQL 连接问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!