English 中文(简体)
数据库在清理所有各行后没有变化
原标题:Database does not change after clearing all rows

I m 面临主要问题,试图在C#中清除一个数据表。

在数据库中编辑信息的所有其它各点,我都使用了类似的东西。

somethingTableTableAdapter1.Update(greenParksDataSet);  
greenParksDataSet1.AcceptChanges();

而这项工作只是罚款。 然而,在我的发言中,我有一个州要清除公开的表格。 看来,可以读取数据,但并未实际宣传数据库的变化。 基本上,法典oil倒到底

greenParksDataSet.HistoryTable.RecieptIDColumn.AutoIncrementSeed = -1;
greenParksDataSet.HistoryTable.RecieptIDColumn.AutoIncrementSeed = -1;
greenParksDataSet.HistoryTable.RecieptIDColumn.AutoIncrementSeed = 1;
greenParksDataSet.HistoryTable.RecieptIDColumn.AutoIncrementSeed = 1;
greenParksDataSet.HistoryTable.Rows.Clear();


historyTableTableAdapter.Update(greenParksDataSet);
greenParksDataSet.AcceptChanges();

我尝试了与事情顺序相近的我,但似乎没有任何工作。 有了该代码,数据可予以清除(数据GridView显示这些改动),但在添加“代码”时,数据可下载。

我很可能忽略了一些显而易见的事情,但我很抱着这种态度对年龄段感到迷惑,希望得到任何帮助。 感谢!

最佳回答
问题回答

我认为,你正在利用一个具有约束力的来源来尝试:

greenParksDataSet.HistoryTable.Rows.Clear();
HistoryTableBindingSource.EndEdit();

historyTableTableAdapter.Update(greenParksDataSet);
greenParksDataSet.AcceptChanges();




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

热门标签