Re: Options for DataTable string comparisons
From: Bill Menees (Bill_at_NoSpam.com)
Date: 11/03/04
- Next message: Jan Nielsen: "Re: Check if .RowFilter returns no records and cancel..."
- Previous message: Jan Nielsen: "Re: Check if .RowFilter returns no records and cancel..."
- In reply to: Kevin Yu [MSFT]: "RE: Options for DataTable string comparisons"
- Next in thread: Kevin Yu [MSFT]: "Re: Options for DataTable string comparisons"
- Reply: Kevin Yu [MSFT]: "Re: Options for DataTable string comparisons"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 07:07:08 -0600
Yes, that is the correct interpretation of the issue: ignoring trailing
whitespace in key comparisons should be optional.
I'm aware that DataTable behaves like SQL Server, but DataTable should be
more generic than that. SQL Server's whitespace handling rules are
different from other databases' rules (e.g., Oracle). Since .NET supports
Oracle access, DataTable ought to be able to handle key comparisons in an
Oracle-compatible way too. (FWIW, I don't like Oracle, but I have to
support it because some of my clients use it.)
I used the Reflector utility to decompile several System.Data classes and
ultimately tracked the trailing whitespace logic back into the internal
DataTable.Compare method. It always ignores trailing spaces, but it should
be very simple to allow each DataColumn to specify whether or not trailing
spaces should be ignored. It can easily be done as a non-breaking change if
DataColumn exposes a new read/write bool property that defaults to the
current "ignore" behavior. (I mention that it would be a non-breaking
change because I'm sure the .NET 2.0 API is pretty close to being locked
down...)
Thanks for your response and for forwarding this to the correct group,
Bill
- Next message: Jan Nielsen: "Re: Check if .RowFilter returns no records and cancel..."
- Previous message: Jan Nielsen: "Re: Check if .RowFilter returns no records and cancel..."
- In reply to: Kevin Yu [MSFT]: "RE: Options for DataTable string comparisons"
- Next in thread: Kevin Yu [MSFT]: "Re: Options for DataTable string comparisons"
- Reply: Kevin Yu [MSFT]: "Re: Options for DataTable string comparisons"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|