logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Warning: FbDataReader.GetOrdinal Method is culture sensitive, any suggestio: msg#00148

Subject: Warning: FbDataReader.GetOrdinal Method is culture sensitive, any suggestions?
We got a bug report from a Norwegian user of our software, I set my system
to Norwegian and saw that GetOrdinal is throwing an index out of range
exception on GetOrdinal("aActive").  
(1.7.0.1 rc4)
 
---
A first chance exception of type 'System.IndexOutOfRangeException' occurred
in firebirdsql.data.firebird.dll
Additional information: Could not find specified column in results.
---
 
I discovered that "aA" has a completely different meaning in Norwegian, see
this MSDN page for explanation:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcustomcasemappingssortingrules.asp

Excerpt:
"The alphabets of nine cultures in the ASCII range (Unicode 0000- Unicode
007F) contain two-letter pairs where the result of a case-insensitive
comparison, such as String.Compare, does not evaluate to equal when the case
is mixed. These cultures are "hr-HR" (Croatian in Croatia), "cs-CZ" (Czech
in the Czech Republic), "sk-SK" (Slovak in Slovakia), "da-DK" (Danish in
Denmark), "nb-NO" (Norwegian (Bokmal) in Norway), "nn-NO" (Norwegian
(Nynorsk) in Norway), "hu-HU" (Hungarian in Hungary), "vi-VN" (Vietnamese in
Vietnam) and "es-ES" (Spanish in Spain) using the traditional sort order.
For example, in the Danish language, a case-insensitive comparison of the
two-letter pairs aA and AA is not considered equal."
 
What appears to be happening is that GetOrdinal is using a culture sensitive
comparison method either inadvertantly or by design.

I'm guessing by design, but it's a mystery to me how to deal definitively
with it.  Our software is used world-wide and I need to know that I'm going
to be using the English comparison for field names since they are written in
English.  Or pick over all the field names and attempt to avoid the letter
pairings, but that's not very practical.
 
Or is there a better way to handle this in general, maybe put a wrapper
around GetOrdinal to specify the thread culture neutrally temporarily or
....?
 
Any help and or info would be greatly appreciated.
 
Cheers
 
- John



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>