Comparison...betweem DataReader value & string

Results 1 to 2 of 2

Thread: Comparison...betweem DataReader value & string

  1. #1
    Join Date
    Dec 1969

    Default Comparison...betweem DataReader value & string

    Hi! All,<BR><BR> I am stuck up in comparison of 2 strings. sound very funny ... have tried out every code snippet found on Net but sigh! finally, posting this Q. here.<BR>1 value is in DataReader & other is string whose value is set in code.i am using following code. when strings r equal it should return Zero , but it is not.<BR>&#039;************************************ ********************<BR>Dim CompResult as Int16<BR>Dim Emp as String = "EMPLOYEE"<BR><BR>CompResult = String.Compare(objDataReader.GetString(1),Emp)<BR> <BR>Response.write ("<BR> Result is = " & CompResult.ToString() ) <BR>&#039;**************************************** *********************<BR>Value of objDataReader.GetString(1) is also :- EMPLOYEE<BR>I checked the case of both strings. Even, checked with using ToUpper() for both strings.But , :( ...<BR>do any 1 have idea abt. this. cud u plz. help me.<BR><BR>TIA ....<BR>

  2. #2

    Default RE: Comparison...betweem DataReader value & string

    Have you checked the values returned from objDataReader.GetString(1) by putting it in a temp variable to make sure it has the value you expect.<BR><BR>Maybe the two text are in different encodings??...<BR><BR>String compare ref if it helps:<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts