How come the following statement isn't true? Where the value of drDataRow.Item("CG_VEND_NBR") is 2 {long}???????
If DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64) = 2 Then
' Do something
End If
Printable View
How come the following statement isn't true? Where the value of drDataRow.Item("CG_VEND_NBR") is 2 {long}???????
If DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64) = 2 Then
' Do something
End If
my guess (even though I dont know what this code is or does) is that just because
drDataRow.Item("CG_VEND_NBR") = 2
doesn't mean that
DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64) = 2
try debuging to see what the value is when you do
DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64)
and see what the value is
I checked it, it's 2 {long} still. Thanks for the input though.
Bit wise they are not the same.... DirectCast your 2 to a Int64 and see if yo uthen get the desired results.Quote:
Originally posted by SeanGrebey
I checked it, it's 2 {long} still. Thanks for the input though.
TG
Bizarre, I have a break point here, and I did an evaluate on the : DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64) = 2 part, and it evaluates to true, but it doesn't step into the loop. I don't get it.
If DirectCast(drDataRow.Item("CG_VEND_NBR"), System.Int64) = 2 Then
' Do something
End If
Sean,
If I were coding this, I would declare a constant of type Int64 and assign it the value "2" and then compare your DirectCast value to that.
John