B
Bill Menees
Are there any plans to make string comparisons within DataTables more
configurable? Specifically, I'd like to be able to specify different
compare options for each DataColumn in a DataTable.
My primary problem is that I'm loading varchar data from an Oracle table
into a DataTable. The primary key values can differ only by trailing
whitespace in the database. When I try to add the primary key on the
DataTable, it throws a UniqueConstraint violation because it says the values
aren't unique. For example, in the database "X" and "X " are distinct
values. When the DataTable compares the two, it treats them as the same.
It looks like it would be very simple to add support for a
"ConsiderTrailingWhitespace" comparison option at the DataTable or
DataColumn level. The DataTable.Compare method (where all the work is done)
is internal, so it shouldn't break anyone's code to add this.
Hoping this will be in .NET 2.0,
Bill
configurable? Specifically, I'd like to be able to specify different
compare options for each DataColumn in a DataTable.
My primary problem is that I'm loading varchar data from an Oracle table
into a DataTable. The primary key values can differ only by trailing
whitespace in the database. When I try to add the primary key on the
DataTable, it throws a UniqueConstraint violation because it says the values
aren't unique. For example, in the database "X" and "X " are distinct
values. When the DataTable compares the two, it treats them as the same.
It looks like it would be very simple to add support for a
"ConsiderTrailingWhitespace" comparison option at the DataTable or
DataColumn level. The DataTable.Compare method (where all the work is done)
is internal, so it shouldn't break anyone's code to add this.
Hoping this will be in .NET 2.0,
Bill