Bug in datatable.select

  • Thread starter Thread starter Thorben Jensen
  • Start date Start date
T

Thorben Jensen

If you use a datatable select on a column that contains a GUID you will have
a major problem if you are not using US language.

We are using Danish language and when selecting like this:
ds.Tables(0).Select(GuidColumn = 'SomeGUID')

It will not always return the row as expected, I suspect the problem is that
in Denmark the character "å" is the same as "aa" and one side of the
equation returns "å" while the other returns "aa".

This is a serious bug and should be fixed ASAP - I have reported this to MS
6 months ago, but to no avail.

For anyone interested I can send a project that demonstrates this behaviour.

Regards
Thorben Jensen
 
Thorben,

Hvorden har du det?

Okay, I think I'm confused here. Does the error happen when 'SomeGUID' has
two 'a' characters in a row and it's converting it to 'å'?

You said 'one side of the equation returns "å" while the other returns
"aa".'

What exactly does that mean? I may have a solution, but I need to know the
specific problem a little better.

Takk.

Pete
 
Thorben,
Have you tried setting the thread culture to us-en before doing the
comparison and then setting it back to Danish afterwards? I don't know that
that would do it, but just a possibility. I noticed the code you sent me was
setting the thread culture to us-en, so I'm assuming that doesn't work, but
thought it was worth checking.

Also, have you tried setting the cultureUI to us-en just for the select?

The bug appears to be in the method LoadExpression() of the undocumented
class ExpressionParser(), though I could be wrong. It seems that the way it
does the conversion of the string to/from individual characters may be
causing the problem, so I'm hoping that setting the culture just for the
select, will have the desired effect.

Pete
 
Hi,

Just ran into the same problem (also on a Danish configuration).

Dammit, and it's in a beta-released program.

Please let me know of any news.


Best regards,
Thomas S. Andersen
(e-mail address removed)
 
The solution

I ran into the same problem with .NET 2.0 so the problem is obviously still not solved. The solution is to cast the GUID to type 'System.Data' e.g:
ds.Tables(0).Select(Convert(GuidColumn, 'System.String') = 'SomeGUID')


 
Back
Top