فهرست منبع

2007-02-23 Nagappan A <[email protected]>

	* DataRow.cs (Item): Checks whether this DataRow exist in the
	DataRowCollection, then compute the expression. Fixes bug #
	80505.

	* DataRowCollection.cs (IndexOf): Modified as internal method for
	1.0 profile.


svn path=/trunk/mcs/; revision=73359
Nagappan Alagappan 19 سال پیش
والد
کامیت
c8cd0fb2f7

+ 7 - 0
mcs/class/System.Data/System.Data/ChangeLog

@@ -1,5 +1,12 @@
 2007-02-23  Nagappan A  <[email protected]>
 
+	* DataRow.cs (Item): Checks whether this DataRow exist in the
+	DataRowCollection, then compute the expression. Fixes bug #
+	80505.
+
+	* DataRowCollection.cs (IndexOf): Modified as internal method for
+	1.0 profile.
+
 	* XmlDataReader.cs (StringToObject): DataTables containing
 	System.Type throw exception on deserializing. Fixes bug # 80596.
 

+ 1 - 1
mcs/class/System.Data/System.Data/DataRow.cs

@@ -255,7 +255,7 @@ namespace System.Data {
 				DataColumn column = _table.Columns[columnIndex];
 				int recordIndex = IndexFromVersion(version);
 
-				if (column.Expression != String.Empty) {
+				if (column.Expression != String.Empty && _table.Rows.IndexOf (this) != -1) {
 					object o = column.CompiledExpression.Eval (this);
 					if (o != null && o != DBNull.Value) {
 						o = Convert.ChangeType (o, column.DataType);

+ 6 - 2
mcs/class/System.Data/System.Data/DataRowCollection.cs

@@ -119,7 +119,11 @@ namespace System.Data
 		}
 
 #if NET_2_0
-		public int IndexOf (DataRow row) 
+		public
+#else
+		internal
+#endif
+		int IndexOf (DataRow row) 
 		{
 			if (row == null)
 				return -1;
@@ -134,7 +138,7 @@ namespace System.Data
 
 			return -1;
 		}
-#endif
+
 		internal void AddInternal (DataRow row) {
 			AddInternal (row, DataRowAction.Add);
 		}