зеркало из https://github.com/mono/mail-archives.git
192 строки
7.6 KiB
HTML
192 строки
7.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-bugs] [Bug 75227][Nor] New - DataSet.GetChanges() fails when
|
|
dataset includes deleted rows
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075227%5D%5BNor%5D%20New%20-%20DataSet.GetChanges%28%29%20fails%20when%0A%09dataset%20includes%20deleted%20rows&In-Reply-To=bug-75227%40chernobyl.ximian.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="030264.html">
|
|
<LINK REL="Next" HREF="030266.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-bugs] [Bug 75227][Nor] New - DataSet.GetChanges() fails when
|
|
dataset includes deleted rows</H1>
|
|
<B>bugzilla-daemon at bugzilla.ximian.com</B>
|
|
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075227%5D%5BNor%5D%20New%20-%20DataSet.GetChanges%28%29%20fails%20when%0A%09dataset%20includes%20deleted%20rows&In-Reply-To=bug-75227%40chernobyl.ximian.com"
|
|
TITLE="[Mono-bugs] [Bug 75227][Nor] New - DataSet.GetChanges() fails when
|
|
dataset includes deleted rows">bugzilla-daemon at bugzilla.ximian.com
|
|
</A><BR>
|
|
<I>Fri Jun 10 20:37:35 EDT 2005</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="030264.html">[Mono-bugs] [Bug 75226][Nor] Changed - [PATCH] System.Data
|
|
cascading on update triggered too often
|
|
</A></li>
|
|
<LI>Next message: <A HREF="030266.html">[Mono-bugs] [Bug 75227][Nor] Changed - DataSet.GetChanges() fails
|
|
when dataset includes deleted rows
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#30265">[ date ]</a>
|
|
<a href="thread.html#30265">[ thread ]</a>
|
|
<a href="subject.html#30265">[ subject ]</a>
|
|
<a href="author.html#30265">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Please do not reply to this email- if you want to comment on the bug, go to the
|
|
URL shown below and enter your comments there.
|
|
|
|
Changed by <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">george.barbarosie at gmail.com.</A>
|
|
|
|
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75227">http://bugzilla.ximian.com/show_bug.cgi?id=75227</A>
|
|
|
|
--- shadow/75227 2005-06-10 20:37:35.000000000 -0400
|
|
+++ shadow/75227.tmp.2597 2005-06-10 20:37:35.000000000 -0400
|
|
@@ -0,0 +1,118 @@
|
|
+Bug#: 75227
|
|
+Product: Mono: Class Libraries
|
|
+Version: 1.1
|
|
+OS:
|
|
+OS Details:
|
|
+Status: NEW
|
|
+Resolution:
|
|
+Severity:
|
|
+Priority: Normal
|
|
+Component: Sys.Data
|
|
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">george.barbarosie at gmail.com</A>
|
|
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+TargetMilestone: ---
|
|
+URL:
|
|
+Cc:
|
|
+Summary: DataSet.GetChanges() fails when dataset includes deleted rows
|
|
+
|
|
+This happens only when there's a relation in the dataset.
|
|
+
|
|
+testcase:
|
|
+
|
|
+using System;
|
|
+using System.Data;
|
|
+
|
|
+class Test {
|
|
+ public static void Main() {
|
|
+ DataSet ds = new DataSet("testds");
|
|
+
|
|
+ DataTable tbl = ds.Tables.Add("parent");
|
|
+ DataColumn col = tbl.Columns.Add("id", typeof(int));
|
|
+ col.AutoIncrement = true;
|
|
+ col = tbl.Columns.Add("data", typeof(string));
|
|
+ col.AllowDBNull = false;
|
|
+ tbl.PrimaryKey = new DataColumn[] { tbl.Columns["id"] };
|
|
+
|
|
+ tbl = ds.Tables.Add("child");
|
|
+ col = tbl.Columns.Add("id", typeof(int));
|
|
+ col.AutoIncrement = true;
|
|
+ col = tbl.Columns.Add("parent", typeof(int));
|
|
+ tbl.Columns.Add("data", typeof(string));
|
|
+ tbl.PrimaryKey = new DataColumn[] { tbl.Columns["id"] };
|
|
+
|
|
+ ds.Relations.Add("child2parent",
|
|
+ ds.Tables["parent"].Columns["id"],
|
|
+ ds.Tables["child"].Columns["parent"]);
|
|
+
|
|
+ DataRow row = ds.Tables["parent"].NewRow();
|
|
+ row["data"] = "something on parent";
|
|
+ ds.Tables["parent"].Rows.Add(row);
|
|
+
|
|
+ row = ds.Tables["child"].NewRow();
|
|
+ row["data"] = "something on child";
|
|
+ row["parent"] = 0;
|
|
+ ds.Tables["child"].Rows.Add(row);
|
|
+ ds.AcceptChanges();
|
|
+
|
|
+ row = ds.Tables["child"].Rows.Find(0);
|
|
+ row.Delete();
|
|
+
|
|
+ try {
|
|
+ ds.GetChanges();
|
|
+ } catch (Exception e) {
|
|
+ Console.WriteLine("Exception caught (1):");
|
|
+ Console.WriteLine(e);
|
|
+ }
|
|
+
|
|
+ ds.RejectChanges();
|
|
+
|
|
+ row = ds.Tables["parent"].Rows.Find(0);
|
|
+ row.Delete();
|
|
+
|
|
+ try {
|
|
+ ds.GetChanges();
|
|
+ } catch (Exception e) {
|
|
+ Console.WriteLine("Exception caught (2):");
|
|
+ Console.WriteLine(e);
|
|
+ }
|
|
+
|
|
+ }
|
|
+}
|
|
+
|
|
+Expected results: should not throw an exception;
|
|
+
|
|
+Actual results:
|
|
+
|
|
+Exception caught (1):
|
|
+System.Data.DeletedRowInaccessibleException: Deleted row information cannot
|
|
+be accessed through the row.
|
|
+in <0x000ba> System.Data.DataRow:IndexFromVersion (DataRowVersion version)
|
|
+in <0x0014a> System.Data.DataRow:GetParentRows (System.Data.DataRelation
|
|
+relation, DataRowVersion version)
|
|
+in <0x00016> System.Data.DataRow:GetParentRow (System.Data.DataRelation
|
|
+relation, DataRowVersion version)
|
|
+in <0x00015> System.Data.DataRow:GetParentRow (System.Data.DataRelation
|
|
+relation)
|
|
+in <0x000b6> System.Data.DataSet:AddChangedRow
|
|
+(System.Collections.Hashtable addedRows, System.Data.DataTable copyTable,
|
|
+System.Data.DataRow row)
|
|
+in <0x00148> System.Data.DataSet:GetChanges (DataRowState rowStates)
|
|
+in <0x0000f> System.Data.DataSet:GetChanges ()
|
|
+in <0x00457> Test:Main ()
|
|
+Exception caught (2):
|
|
+System.Data.DeletedRowInaccessibleException: Deleted row information cannot
|
|
+be accessed through the row.
|
|
+in <0x000ba> System.Data.DataRow:IndexFromVersion (DataRowVersion version)
|
|
+in <0x0014a> System.Data.DataRow:GetParentRows (System.Data.DataRelation
|
|
+relation, DataRowVersion version)
|
|
+in <0x00016> System.Data.DataRow:GetParentRow (System.Data.DataRelation
|
|
+relation, DataRowVersion version)
|
|
+in <0x00015> System.Data.DataRow:GetParentRow (System.Data.DataRelation
|
|
+relation)
|
|
+in <0x000b6> System.Data.DataSet:AddChangedRow
|
|
+(System.Collections.Hashtable addedRows, System.Data.DataTable copyTable,
|
|
+System.Data.DataRow row)
|
|
+in <0x00148> System.Data.DataSet:GetChanges (DataRowState rowStates)
|
|
+in <0x0000f> System.Data.DataSet:GetChanges ()
|
|
+in <0x00514> Test:Main ()
|
|
</PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="030264.html">[Mono-bugs] [Bug 75226][Nor] Changed - [PATCH] System.Data
|
|
cascading on update triggered too often
|
|
</A></li>
|
|
<LI>Next message: <A HREF="030266.html">[Mono-bugs] [Bug 75227][Nor] Changed - DataSet.GetChanges() fails
|
|
when dataset includes deleted rows
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#30265">[ date ]</a>
|
|
<a href="thread.html#30265">[ thread ]</a>
|
|
<a href="subject.html#30265">[ subject ]</a>
|
|
<a href="author.html#30265">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
|
|
mailing list</a><br>
|
|
</body></html>
|