string comparison
From: Harold Hsu (haroldh_at_ingenium-tech.com)
Date: 09/23/04
- Next message: CJ Taylor: "Re: Decompiler.NET reverse engineers your CLS compliant code"
- Previous message: Bob Dufour: "Writing User name to a custom log"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: string comparison"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: string comparison"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 13:15:05 -0700
Hi all,
We have a piece of code that reads data from SQL Server and data from
Oracle. They are both strings. We are trying to compare the two strings
(dr(column).ToString()) for equality. When we display the string on screen,
they are the same. But when we try str1.CompareTo(str2), it returns -1. We
tried the following and they all return -1:
StrComp(str1, str2, CompareMethod.Text)
StrComp(str1, str2, CompareMethod.Binary)
String.Compare(str1, str2, true,
System.Globalization.CultureInfo.InvariantCulture)
But when we do a char by char comparision, all chars are equal.
Any suggestions on what might be the problem? I don't even know if it has
anything to do with the databases.
Thanks,
Harold
- Next message: CJ Taylor: "Re: Decompiler.NET reverse engineers your CLS compliant code"
- Previous message: Bob Dufour: "Writing User name to a custom log"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: string comparison"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: string comparison"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|