Hello:
I send two patches for make DataColumnCollection indexer by name and the
Hashtable of DataTableCollection to be non case sensitive ( ths solution
of te hastable is a suggestion of Gonzalo).
I think that on DataColumnCollection can be other methods affected by te
same issue ( can be a good idea to use a Hastable like on
DataTableCollection ??? )
Best regards
Carlos Guzm�n �lvarez
Vigo-Spain
Index: DataTableCollection.cs
===================================================================
RCS file: /mono/mcs/class/System.Data/System.Data/DataTableCollection.cs,v
retrieving revision 1.8
diff -u -r1.8 DataTableCollection.cs
--- DataTableCollection.cs 12 Nov 2002 01:41:04 -0000 1.8
+++ DataTableCollection.cs 21 Nov 2002 15:04:17 -0000
@@ -32,7 +32,7 @@
: base ()
{
this.dataSet = dataSet;
- this.tables = new Hashtable ();
+ this.tables = new Hashtable
+(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
}
#endregion
Index: DataColumnCollection.cs
===================================================================
RCS file: /mono/mcs/class/System.Data/System.Data/DataColumnCollection.cs,v
retrieving revision 1.10
diff -u -r1.10 DataColumnCollection.cs
--- DataColumnCollection.cs 12 Nov 2002 01:41:04 -0000 1.10
+++ DataColumnCollection.cs 21 Nov 2002 15:36:03 -0000
@@ -56,7 +56,17 @@
return column;
}
}
- return null;
+
+ // If no column found make a non case sensitive search
+of the column name
+ foreach (DataColumn column in base.List)
+ {
+ if (column.ColumnName.ToUpper() ==
+name.ToUpper())
+ {
+ return column;
+ }
+ }
+
+ return null;
}
}