Article ID: 932491
Article Last Modified on 12/3/2007
APPLIES TO
- Microsoft .NET Framework 2.0
SYMPTOMS
When you try to use a component in an application that is built on the Microsoft .NET Framework 2.0, data that is associated with the component may become corrupted. This problem occurs when the component uses a System.Data.DataSet object. When this problem occurs, you may experience one or more of the following issues:
- When the AcceptChanges method in a DataView class is called, the record manager may become corrupted.
- The computed values in an expression column may not be updated correctly.
- When the DataTable.Select method is called by using multiple statements, an incorrect result may be returned.
- The internal index of a DataTable object may become corrupted. Additionally, you receive a '13' error message.
- When a Merge operation occurs, the record manager may become corrupted if the target row is in the edit state.
- The internal index of a DataTable object may become corrupted. Additionally, you receive a '5' error message.
RESOLUTION
Download information
The following file is available for download from the Microsoft Download Center:
Download the 303313_intl_x64_zip.exe package or the 303314_intl_i386_zip.exe package or the 303315_intl_ia64_zip.exe package now.
Release Date: 6/20/2007
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft .NET Framework 2.0 service pack that contains this hotfix.
To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
Prerequisites
There are no prerequisites for installing this hotfix.
Restart requirement
You do not have to restart your computer after you apply this hotfix.
Hotfix replacement information
This hotfix does not replace any other hotfixes.
File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
For x86-based computers
File name | File version | File size | Date | Time | Platform |
---|---|---|---|---|---|
Mscordacwks.dll | 2.0.50727.802 | 802,304 | 03-Feb-2007 | 11:22 | x86 |
Mscorjit.dll | 2.0.50727.802 | 326,656 | 03-Feb-2007 | 11:22 | x86 |
Mscorlib.dll | 2.0.50727.802 | 4,308,992 | 03-Feb-2007 | 11:22 | x86 |
Mscorpe.dll | 2.0.50727.802 | 102,912 | 03-Feb-2007 | 11:22 | x86 |
Mscorwks.dll | 2.0.50727.802 | 5,625,344 | 03-Feb-2007 | 11:21 | x86 |
Normalization.dll | 2.0.50727.802 | 15,360 | 03-Feb-2007 | 11:22 | x86 |
Normidna.nlp | Not Applicable | 59,342 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfc.nlp | Not Applicable | 45,794 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfd.nlp | Not Applicable | 39,284 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkc.nlp | Not Applicable | 66,384 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkd.nlp | Not Applicable | 60,294 | 03-Feb-2007 | 11:22 | Not Applicable |
Peverify.dll | 2.0.50727.802 | 136,192 | 03-Feb-2007 | 11:21 | x86 |
Sos.dll | 2.0.50727.802 | 382,464 | 03-Feb-2007 | 11:22 | x86 |
System.data.dll | 2.0.50727.802 | 2,902,016 | 03-Feb-2007 | 11:22 | x86 |
System.data.oracleclient.dll | 2.0.50727.802 | 482,304 | 03-Feb-2007 | 11:22 | x86 |
Vsavb7rt.dll | 8.0.50727.802 | 1,330,688 | 03-Feb-2007 | 11:21 | x86 |
For x64-based computers
File name | File version | File size | Date | Time | Platform |
---|---|---|---|---|---|
Mscordacwks.dll | 2.0.50727.802 | 1,597,440 | 03-Feb-2007 | 03:14 | x64 |
Mscordacwks.dll | 2.0.50727.802 | 802,304 | 03-Feb-2007 | 11:22 | x86 |
Mscorjit.dll | 2.0.50727.802 | 1,587,712 | 03-Feb-2007 | 03:13 | x64 |
Mscorjit.dll | 2.0.50727.802 | 326,656 | 03-Feb-2007 | 11:22 | x86 |
Mscorlib.dll | 2.0.50727.802 | 3,960,832 | 03-Feb-2007 | 06:28 | x64 |
Mscorlib.dll | 2.0.50727.802 | 4,308,992 | 03-Feb-2007 | 11:22 | x86 |
Mscorpe.dll | 2.0.50727.802 | 157,184 | 03-Feb-2007 | 03:07 | x64 |
Mscorpe.dll | 2.0.50727.802 | 102,912 | 03-Feb-2007 | 11:22 | x86 |
Mscorpjt.dll | 2.0.50727.802 | 2,004,992 | 03-Feb-2007 | 03:13 | x64 |
Normalization.dll | 2.0.50727.802 | 18,432 | 03-Feb-2007 | 03:12 | x64 |
Normalization.dll | 2.0.50727.802 | 15,360 | 03-Feb-2007 | 11:22 | x86 |
Normidna.nlp | Not Applicable | 59,342 | 03-Feb-2007 | 03:14 | Not Applicable |
Normidna.nlp | Not Applicable | 59,342 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfc.nlp | Not Applicable | 45,794 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfc.nlp | Not Applicable | 45,794 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfd.nlp | Not Applicable | 39,284 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfd.nlp | Not Applicable | 39,284 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkc.nlp | Not Applicable | 66,384 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfkc.nlp | Not Applicable | 66,384 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkd.nlp | Not Applicable | 60,294 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfkd.nlp | Not Applicable | 60,294 | 03-Feb-2007 | 11:22 | Not Applicable |
Peverify.dll | 2.0.50727.802 | 136,192 | 03-Feb-2007 | 11:21 | x86 |
Peverify.nlp | 2.0.50727.802 | 205,824 | 03-Feb-2007 | 03:13 | Not Applicable |
Sos.dll | 2.0.50727.802 | 480,768 | 03-Feb-2007 | 03:22 | x64 |
Sos.dll | 2.0.50727.802 | 382,464 | 03-Feb-2007 | 11:22 | x86 |
System.data.dll | 2.0.50727.802 | 2,967,040 | 03-Feb-2007 | 06:28 | x64 |
System.data.dll | 2.0.50727.802 | 2,902,016 | 03-Feb-2007 | 11:22 | x86 |
System.data.oracleclient.dll | 2.0.50727.802 | 498,688 | 03-Feb-2007 | 06:28 | x64 |
System.data.oracleclient.dll | 2.0.50727.802 | 482,304 | 03-Feb-2007 | 11:22 | x86 |
Mscorwks.dll | 2.0.50727.802 | 10,323,456 | 03-Feb-2007 | 03:11 | x64 |
Mscorwks.dll | 2.0.50727.802 | 5,625,344 | 03-Feb-2007 | 11:21 | x86 |
Vsavb7rt.dll | 8.0.50727.802 | 1,330,688 | 03-Feb-2007 | 11:21 | x86 |
For Itanium-based computers
File name | File version | File size | Date | Time | Platform |
---|---|---|---|---|---|
Mscordacwks.dll | 2.0.50727.802 | 2,719,232 | 03-Feb-2007 | 03:15 | IA-64 |
Mscordacwks.dll | 2.0.50727.802 | 802,304 | 03-Feb-2007 | 11:22 | x86 |
Mscorjit.dll | 2.0.50727.802 | 2,705,920 | 03-Feb-2007 | 03:13 | IA-64 |
Mscorjit.dll | 2.0.50727.802 | 326,656 | 03-Feb-2007 | 11:22 | x86 |
Mscorlib.dll | 2.0.50727.802 | 3,960,832 | 03-Feb-2007 | 06:42 | IA-64 |
Mscorlib.dll | 2.0.50727.802 | 4,308,992 | 03-Feb-2007 | 11:22 | x86 |
Mscorpe.dll | 2.0.50727.802 | 313,856 | 03-Feb-2007 | 03:06 | IA-64 |
Mscorpe.dll | 2.0.50727.802 | 102,912 | 03-Feb-2007 | 11:22 | x86 |
Mscorpjt.dll | 2.0.50727.802 | 3,501,056 | 03-Feb-2007 | 03:14 | IA-64 |
Normalization.dll | 2.0.50727.802 | 15,360 | 03-Feb-2007 | 11:22 | x86 |
Normalization.dll | 2.0.50727.802 | 44,032 | 03-Feb-2007 | 03:12 | IA-64 |
Fl_normidna.nlp | Not Applicable | 59,342 | 03-Feb-2007 | 11:22 | Not Applicable |
Normidna.nlp | Not Applicable | 59,342 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfc.nlp | Not Applicable | 45,794 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfc.nlp | Not Applicable | 45,794 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfd.nlp | Not Applicable | 39,284 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfd.nlp | Not Applicable | 39,284 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfkc.nlp | Not Applicable | 66,384 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkc.nlp | Not Applicable | 66,384 | 03-Feb-2007 | 03:14 | Not Applicable |
Normnfkd.nlp | Not Applicable | 60,294 | 03-Feb-2007 | 11:22 | Not Applicable |
Normnfkd.nlp | Not Applicable | 60,294 | 03-Feb-2007 | 03:14 | Not Applicable |
Peverify.dll | 2.0.50727.802 | 136,192 | 03-Feb-2007 | 11:21 | x86 |
Peverify.dll | 2.0.50727.802 | 383,488 | 03-Feb-2007 | 03:13 | IA-64 |
Sos.dll | 2.0.50727.802 | 382,464 | 03-Feb-2007 | 11:22 | x86 |
Sos.dll | 2.0.50727.802 | 862,720 | 03-Feb-2007 | 03:23 | IA-64 |
System.data.dll | 2.0.50727.802 | 2,902,016 | 03-Feb-2007 | 11:22 | x86 |
System.data.dll | 2.0.50727.802 | 3,109,888 | 03-Feb-2007 | 06:42 | IA-64 |
System.data.oracleclient.dll | 2.0.50727.802 | 482,304 | 03-Feb-2007 | 11:22 | x86 |
System.data.oracleclient.dll | 2.0.50727.802 | 501,760 | 03-Feb-2007 | 06:42 | IA-64 |
Mscorwks.dll | 2.0.50727.802 | 5,625,344 | 03-Feb-2007 | 11:21 | x86 |
Mscorwks.dll | 2.0.50727.802 | 21,309,952 | 03-Feb-2007 | 03:11 | IA-64 |
Vsavb7rt.dll | 8.0.50727.802 | 1,330,688 | 03-Feb-2007 | 11:21 | x86 |
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
MORE INFORMATION
Issue 1: When the AcceptChanges method in a DataView class is called, the record manager may become corrupted
Record manager corruption may occur during a write operation from an event handler. When this occurs, a System.NullreferenceException exception may be raised. Additionally, when the application performs a write operation in a ListChanged event, index updates may occur in the incorrect order.
For example, consider the following scenario:
You use the following code in the application:
using System; using System.ComponentModel; using System.Data; class Test { private static DataRow _dr = null; private static bool _accept = false; public static void Main() { try { DataSet ds = new DataSet(); DataTable dt = ds.Tables.Add("Customers"); DataColumn c = dt.Columns.Add("Id", typeof(int)); dt.PrimaryKey = new DataColumn[] { c }; dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Age", typeof(int)); dt.Rows.Add(new object[] { 1, "A", 10 }); dt.Rows.Add(new object[] { 2, "B", 20 }); dt.Rows.Add(new object[] { 3, "G", 30 }); dt.Rows.Add(new object[] { 4, "H", 40 }); dt.Rows.Add(new object[] { 5, "I", 50 }); ds.AcceptChanges(); DataView dv = new DataView(dt); dv.Sort = "Name ASC"; dv.ListChanged += new ListChangedEventHandler(OnListChanged); _dr = dt.Rows[4]; _accept = true; _dr["Name"] = "C"; _accept = false; _dr["Name"] = "D"; _dr["Age"] = 55; Console.WriteLine(dv[2][1]); } catch (Exception exc) { Console.WriteLine(exc); } } public static void OnListChanged(object sender, ListChangedEventArgs args) { if (_dr != null && _accept) { _dr.AcceptChanges(); } } }
- You run the application.
In this scenario, you receive an error message that resembles the following error message:
To work around this issue, do not perform any write operations in a ListChanged event. It is best to use the RowChanged event instead of the ListChanged event.
Issue 2: The computed values in an expression column may not be updated correctly
When you try to compute the values of an expression column in a DataSet object, and the expression column is part of a relationship, the computed values of the expression column may not be updated correctly. For example, consider the following scenario:
You use the following code in the application:
using System; using System.ComponentModel; using System.Data; class Test { public static void Main() { try { DataSet ds = new DataSet(); DataTable dt1 = ds.Tables.Add("T1"); dt1.Columns.Add("CustId", typeof(int)); dt1.Columns.Add("CustName", typeof(string)); DataTable dt2 = ds.Tables.Add("T2"); dt2.Columns.Add("EmpId", typeof(int)); DataColumn dcEmpName = dt2.Columns.Add("EmpName", typeof(string)); DataColumn dcMgrName = dt2.Columns.Add("MgrName", typeof(string)); DataColumn dcReports = dt2.Columns.Add("NumberOfReports", typeof(int)); DataRelation rel1 = ds.Relations.Add("T1T2", dt1.Columns["CustId"], dt2.Columns["EmpId"], false); DataRelation rel2 = ds.Relations.Add("T2T2", dt2.Columns["EmpName"], dt2.Columns["MgrName"], false); dcEmpName.Expression = "Parent(T1T2).CustName"; dcMgrName.Expression = "Parent(T1T2).CustName"; //Each person is a manager to himself. dcReports.Expression = "Count(Child(T2T2).EmpName)"; AddRow(dt1, 1, "N1"); AddRow(dt1, 2, "N2"); AddRow(dt1, 3, "N3"); AddRow(dt2, 1); AddRow(dt2, 2); AddRow(dt2, 3); Console.WriteLine(ds.GetXml()); dt1.Rows[0]["CustName"] = "N4"; Console.WriteLine(ds.GetXml()); } catch (Exception exc) { Console.WriteLine(exc); } } public static void AddRow(DataTable dt, params object[] objArr) { Console.WriteLine("Adding row to table {0}", dt.TableName); dt.Rows.Add(objArr); } }
- You run the application.
In this scenario, you receive the following output:
<NewDataSet> <T1> <CustId>1</CustId> <CustName>N4</CustName> </T1> <T1> <CustId>2</CustId> <CustName>N2</CustName> </T1> <T1> <CustId>3</CustId> <CustName>N3</CustName> </T1> <T2> <EmpId>1</EmpId> <EmpName>N4</EmpName> <MgrName>N4</MgrName> <NumberOfReports>0</NumberOfReports> </T2> <T2> <EmpId>2</EmpId> <EmpName>N2</EmpName> <MgrName>N2</MgrName> <NumberOfReports>1</NumberOfReports> </T2> <T2> <EmpId>3</EmpId> <EmpName>N3</EmpName> <MgrName>N3</MgrName> <NumberOfReports>1</NumberOfReports> </T2> </NewDataSet>
In this output, the NumberOfReports element in the first T2 element contains the incorrect value of 0 instead of 1.
Issue 3: When the DataTable.Select method is called by using multiple statements, an incorrect result may be returned
When you use the Select method of a DataTable object together with the AND clause to retrieve data for multiple statements, the Select method may return an incorrect result. For example, the following code returns an incorrect result:
string filter = "(NOT ColTwo = 1) AND (ColOne = 2)"; DataTable.Select(filter);
However, the following code returns the correct result:
string filter = "NOT ColTwo = 1 AND ColOne = 2"; DataTable.Select(filter);
Additionally, consider the following scenario:
You use the following code in the application:
public static void Main() { DataTable table = new DataTable(); table.Columns.Add("ColID", typeof(int)); table.Columns.Add("ColOne", typeof(int)); table.Columns.Add("ColTwo", typeof(int)); table.Rows.Add(new object[] { 1, 1, 1 }); table.Rows.Add(new object[] { 2, 1, 2 }); table.Rows.Add(new object[] { 3, 2, 1 }); table.Rows.Add(new object[] { 4, 2, 2 }); string[] queries = new string[] { "(NOT ColTwo = 1) AND (ColOne = 2)", "(ColOne = 2) AND (NOT ColTwo = 1)", "NOT ColTwo = 1 AND ColOne = 2", "ColOne = 2 AND NOT ColTwo = 1", "NOT ColTwo = 1 AND (ColOne = 2)", "(ColOne = 2) AND NOT ColTwo = 1", "(NOT ColTwo = 1) AND ColOne = 2", "ColOne = 2 AND (NOT ColTwo = 1)", }; Console.WriteLine("Select"); foreach(string query in queries) { DataRow[] rows = table.Select(query); Console.WriteLine("query=\"{0}\" count={1}", query, rows.Length); foreach(DataRow row in rows) { Console.WriteLine("\t{0}, {1}, {2}", row[0], row[1], row[2]); } } }
- You run the application.
In this scenario, you receive the following output:
query="(NOT ColTwo = 1) AND (ColOne = 2)" count=2 3, 2, 1 4, 2, 2 query="(ColOne = 2) AND (NOT ColTwo = 1)" count=1 4, 2, 2 query="NOT ColTwo = 1 AND ColOne = 2" count=1 4, 2, 2 query="ColOne = 2 AND NOT ColTwo = 1" count=1 4, 2, 2 query="NOT ColTwo = 1 AND (ColOne = 2)" count=2 3, 2, 1 4, 2, 2 query="(ColOne = 2) AND NOT ColTwo = 1" count=1 4, 2, 2 query="(NOT ColTwo = 1) AND ColOne = 2" count=1 4, 2, 2 query="ColOne = 2 AND (NOT ColTwo = 1)" count=1 4, 2, 2
In this output, "(ColOne = 2)" is incorrectly displayed on the right side of an AND clause.
Issue 4: The internal index of a DataTable may become corrupted, and you receive a '13' error message
When you try to use the AcceptChanges method of a DataSet object that is used by the DataTable object, and you set a ForeignKey rule to AcceptRule.Cascade, the internal index values that are used by the DataSet object may become corrupted. This issue occurs if the following conditions are true:
- The DataSet object contains one or more tables that have one-to-many relationships.
- The AcceptChanges method of the DataSet object is called.
- The AcceptRejectRule value of the DataSet object is set to Cascade. When this value is set to Cascade, the child table is changed so that it automatically either accepts data or rejects data.
For example, consider the following scenario:
You use the following code in the application:
public void Main() { DataTable Table = new DataTable("Employee"); Table.Columns.Add("Id", typeof(int)); Table.Columns.Add("ManagerId", typeof(int)); Table.Columns.Add("Name", typeof(string)); Table.Columns["Name"].AllowDBNull = false; Table.PrimaryKey = new DataColumn[] {Table.Columns["Id"]}; DataSet Employees = new DataSet(); Employees.Tables.Add(Table); DataRelation rel = Employees.Relations.Add(Table.Columns["ID"], Table.Columns["ManagerId"]); rel.ChildKeyConstraint.AcceptRejectRule = AcceptRejectRule.Cascade; DataRow ManagerA = Table.NewRow(); ManagerA["ID"] = 2019; ManagerA["Name"] = "Manager A"; Table.Rows.Add(ManagerA); DataRow ManagerB = Table.NewRow(); ManagerB["ID"] = 392; ManagerB["Name"] = "Manager B"; Table.Rows.Add(ManagerB); DataRow EmployeeB = Table.NewRow(); EmployeeB["ID"] = 716; EmployeeB["Name"] = "Employee of B"; EmployeeB.SetParentRow(ManagerB); Table.Rows.Add(EmployeeB); EmployeeB = Table.NewRow(); EmployeeB["ID"] = 637; EmployeeB["Name"] = "2nd employee of B"; EmployeeB.SetParentRow(ManagerB); Table.Rows.Add(EmployeeB); Employees.AcceptChanges(); Table.Rows.Find(392).Delete(); Employees.AcceptChanges(); }
- You run the application.
In this scenario, you receive the following error message:
Issue 5: When a Merge operation occurs, the record manager may become corrupted if the target row is in the edit state
If one or more rows in a DataTable object are being edited, and then a DataTable.Merge operation occurs or a DataSet.Merge operation occurs, the record manager for the DataSet object of the DataTable object may become corrupted.
Note When a row in a DataTable object is being edited, the DataRowVersion value of the row is set to Proposed.
For example, consider the following scenario:
You use the following code in the application:
using System; using System.Data; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { DataSet set = new DataSet(); DataTable table = set.Tables.Add("table"); table.Columns.Add("C1", typeof(int)); table.Columns.Add("C2", typeof(char)); table.PrimaryKey = new DataColumn[] { table.Columns[0] }; for (int i = 0; i < 26; ++i) { table.Rows.Add(new object[] { i, (char)((ushort)'a' + i) }); } table.AcceptChanges(); DataSet clone = set.Copy(); clone.Tables[0].Rows[0][1] = 'Z'; //clone.AcceptChanges(); table.Rows[0][1] = '1'; table.Rows[0].BeginEdit(); table.Rows[0][1] = '2'; try { set.Merge(clone); } finally { foreach (DataRow row in table.Rows) { Console.WriteLine("{0}={1}", row[0], row[1]); } } } } }
- You run the application.
In this scenario, the record manager for the DataSet object of the DataTable object is corrupted.
To work around this problem, make sure that there are no rows in the destination DataSet object that have the DataRowVersion value set to Proposed before you use the DataTable.Merge method or the DataSet.Merge method.
Issue 6: The internal index of a DataTable object may become corrupted, and you receive a '5' error message
The following scenarios cause corruption in a DataTable object by changing the data in the DataTable object without updating the internal indexes of the DataTable object:
- The DataColumn.Expression value is changed from an expression to no expression. In this scenario, all the data in the DataColumn object is set to DBNull.
- When the DataTable.Clear method is called, all the data in the DataTable object is removed and the indexes are updated. However, other tables that reference the DataTable object are not updated.
For example, consider the following scenario:
You use the following code in the application:
using System; using System.Data; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { DataSet set = new DataSet("s"); DataTable table1 = set.Tables.Add("a"); table1.Columns.Add("C1", typeof(int)); table1.Columns.Add("C2", typeof(int)); table1.DefaultView.Sort = "C2"; DataTable table2 = set.Tables.Add("b"); table2.Columns.Add("C1", typeof(int)); table2.Columns.Add("C2", typeof(int)); table2.DefaultView.Sort = "C2"; set.Relations.Add(new DataRelation("t1t2", table1.Columns[0], table2.Columns[0], false)); table1.Columns[1].Expression = "Sum(Child(t1t2).C2)"; AddData(table1, 1); AddData(table2, 2); table1.Columns[1].Expression = null; AddData(table2, 2); AddData(table1, 2); } private static void AddData(DataTable table, int y) { object[] x = new object[y]; Random rand = new Random(20070125); for (int i = 0; i < 1000; ++i) { switch (rand.Next(3)) { case 0: case 1: for (int k = 0; k < x.Length; ++k) { x[k] = rand.Next(500); } table.Rows.Add(x); break; case 2: if (0 < table.Rows.Count) { table.Rows.RemoveAt(rand.Next(table.Rows.Count)); } break; } } } } }
- You run the application.
In this scenario, you receive the following error message:
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
Keywords: kbbug kbfix kbqfe kbprb kbpubtypekc kbexpertiseinter kbexpertisebeginner kbhotfixserver KB932491