English 中文(简体)
C# 表Adapter and DataSet Update with multi table
原标题:C# TableAdapter and DataSet update with multiple table

I m new in C# and I need some help.

“enterography

我只想通过下文的法典更新会议桌。

        dbDataSet db = new dbDataSet();
        SessionTableAdapter sessionTableAdapter = new SessionTableAdapter();
        sessionTableAdapter.Fill(db.Session);
        var session = db.Session.Where(s => s.idSession.Equals(new Guid("{0F0B0E1A-950E-4BCE-9C68-6D1387EDAC90}"))).SingleOrDefault();
        session.endTime = DateTime.Now;
        sessionTableAdapter.Update(db.Session);

我在“掌权者”。

An unhandled exception of type  System.Data.OleDb.OleDbException  occurred in System.Data.dll

Additional information: The record cannot be deleted or changed because table  PaidLog  includes related records.

How to fix this error ?

最佳回答

Sol!

首先,我只是衡量“强制依赖性完整性”。

但是,我试图勾画有关领域的最新信息,并且它的工作!

我不知道它为何工作。

任何人都知道这一事情的原因?

顺便提一下,感谢马希普。

“entergraph

问题回答

错误的信息是这样说的。 会议桌与有薪行车监督记录仪有外国关键关系。 你们必须首先从本表上更新儿童牢房。

article onMSDN,详见。 在数据集中更新两个相关的表格,并附上表格Adapter 。 款次

Or you might want to use TableAdapterManager





相关问题
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. ...

热门标签