C# 批量插入集合

 public virtual void BtachImport(List<CamPaignliable> list)
        {
            try
            {
                this.BeginTransaction();
                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        this.InterInsert(list[i]);//insert方法
                    }
                }
                this.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.RollBackTransaction();
                throw ex;
            }
        }

posted @ 2016-08-17 16:55  微笑代表淡定.Net  阅读(884)  评论(0)    收藏  举报