|
-
Jul 8th, 2004, 02:08 PM
#1
Thread Starter
Frenzied Member
How come this statement is false?
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
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jul 8th, 2004, 02:36 PM
#2
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
-
Jul 8th, 2004, 02:45 PM
#3
Thread Starter
Frenzied Member
I checked it, it's 2 {long} still. Thanks for the input though.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jul 8th, 2004, 02:53 PM
#4
Originally posted by SeanGrebey
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.
TG
-
Jul 9th, 2004, 08:22 AM
#5
Thread Starter
Frenzied Member
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
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jul 9th, 2004, 08:50 AM
#6
Hyperactive Member
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
Whadayamean it doesn't work....
It works fine on my machine!

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|