English 中文(简体)
插入但尚待核准的记录的经验背景
原标题:Query Context for Inserted but yet Uncommitted records

我搜索了并搜索了 st流和www,但没有找到这一问题的答案。

我正在通过一些记录,在某些条件下将新记录插入表A。 然后,我再重复另一个数据来源(不能与第一个数据合并),如果是的话,我想在同一个表格A中插入新的记录。 我只想在进程结束时承付这些记录,但如果我插入这些记录,就会造成重大违约错误。

注:linq没有管理主要钥匙。 或许是因为我与林克混在一起,没有真正知道如何按甲骨文顺序开展工作。

我的问题是,我如何检查我所插入的记录的现有背景。 这就是我所做的工作。

foreach(var rec in recordList1)
{
   ...
   dataContext.InsertOnSubmit(obj);
}

foreach(var rec in recordList2)
{
   if ( ! [check context here for existing record] )
   {
      ...
      dataContext.InsertOnSubmit(obj);
   }
}
dataContext.SubmitChanges();

我尝试以不同方式质疑这一背景,但只会损害承诺的价值观。

Thanks in advance! Best regards.

最佳回答

查阅所插入、更新、删除的数据文本,请打电话给GetChangeSet。

var changed = dataContext.GetChangeSet();
var inserted = changed.Inserts;
var updated = changed.Updates;
var deleted = changed.Deletes;
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签