H
Harold Hsu
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
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