
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Windows with Turkish Locale (tr-TR)
|
|
|
when I use FbDataReader to load some data from database on system with tr-TR locale it's not possible to use columns containing with character "i". It's simply because Char.ToUpper('i') does not returns I but "I with dot". So in this case "caseinsensitive" comparison is not enough.
Example
string description = aDataReader["ProductDescription"];
Workaround - use upper characters for I eg. - but it's awfull and hard to test
string description = aDataReader["ProductDescrIptIon"];
I tried to do some quick&dirty fix in FBDataReader.cs in method GetOrdinal. I simple replace original code
if (!columnsIndexes.TryGetValue(name.ToUpper(), out index))
throw new IndexOutOfRangeException("Could not find specified column in results.");
with
if (!columnsIndexes.TryGetValue(name.ToUpper(CultureInfo.InvariantCulture), out index))
throw new IndexOutOfRangeException("Could not find specified column in results.");
but in fact, I think that best fix should be by using something like this:
String.Equals("i", "I", StringComparison.InvariantCultureIgnoreCase)
|
|
Description
|
when I use FbDataReader to load some data from database on system with tr-TR locale it's not possible to use columns containing with character "i". It's simply because Char.ToUpper('i') does not returns I but "I with dot". So in this case "caseinsensitive" comparison is not enough.
Example
string description = aDataReader["ProductDescription"];
Workaround - use upper characters for I eg. - but it's awfull and hard to test
string description = aDataReader["ProductDescrIptIon"];
I tried to do some quick&dirty fix in FBDataReader.cs in method GetOrdinal. I simple replace original code
if (!columnsIndexes.TryGetValue(name.ToUpper(), out index))
throw new IndexOutOfRangeException("Could not find specified column in results.");
with
if (!columnsIndexes.TryGetValue(name.ToUpper(CultureInfo.InvariantCulture), out index))
throw new IndexOutOfRangeException("Could not find specified column in results.");
but in fact, I think that best fix should be by using something like this:
String.Equals("i", "I", StringComparison.InvariantCultureIgnoreCase) |
Show » |
|