linq to sql 的DataContext的 ExecuteCommand()方法

来源:互联网 发布:美工需要的电脑配置 编辑:程序博客网 时间:2024/06/05 19:00
  _context = new DataContext(conn);        public void BeginTrans()        {            if (_context.Connection.State == System.Data.ConnectionState.Closed)                _context.Connection.Open();            _context.Transaction = _context.Connection.BeginTransaction();        }        public void CommitTrans()        {            if (_context.Transaction != null)                 _context.Transaction.Commit();            _context.Connection.Close();        }        public void RollBackTrans()        {            if (_context.Transaction != null)                 _context.Transaction.Rollback();            _context.Connection.Close();        }

来自:http://social.microsoft.com/Forums/fr-FR/adonetzhchs/thread/57fe8efe-61f4-47e4-9f06-fdcee7673637

原创粉丝点击