[Mono-bugs] [Bug 650411] New: DataRow.GetParentRows doesn't work with DataRowVersion.Original
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Oct 31 17:37:56 EDT 2010
https://bugzilla.novell.com/show_bug.cgi?id=650411
https://bugzilla.novell.com/show_bug.cgi?id=650411#c0
Summary: DataRow.GetParentRows doesn't work with
DataRowVersion.Original
Classification: Mono
Product: Mono: Class Libraries
Version: 2.6.x
Platform: x86
OS/Version: Windows 7
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Data
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: cvolzke at live.com.au
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5
When calling DataRow.GetParentRows(relation, DataRowVersion.Original), the
index is queried which uses DataRowVersion.Default and not
DataRowVersion.Original.
Therefore an returned result is returned (usually null).
Reproducible: Always
Steps to Reproduce:
Test case:
DataSet data = new DataSet();
DataTable parent = new DataTable("parent");
DataColumn pk = parent.Columns.Add("pk");
DataTable child = new DataTable("child");
DataColumn fk = child.Columns.Add("fk");
data.Tables.Add(parent);
data.Tables.Add(child);
DataRelation relation = data.Relations.Add(pk, fk);
data.EnforceConstraints = false;
parent.Rows.Add("key");
child.Rows.Add("key");
data.AcceptChanges();
parent.Rows[0][0] = "key2";
Debug.Assert((string)parent.Rows[0]["pk", DataRowVersion.Original]
== "key");
Assert.AreEqual(parent.Rows[0]["pk", DataRowVersion.Current],
"key2");
Assert.AreEqual(child.Rows[0]["fk", DataRowVersion.Current],
"key");
DataRow parentRow = child.Rows[0].GetParentRow(relation,
DataRowVersion.Original);
Assert.IsNotNull(parentRow);
Actual Results:
Null is returned from GetParentRow(relation, DataRowVersion.Original)
Expected Results:
The parent row should be returned from GetParentRow(relation,
DataRowVersion.Original)
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list