P
Problematic coder
Here is the code:
64 If objdr.Item("BD") = "" Or objdr.Item("BD") Is DBNull.Value Then
'test to see if result is blank or null
65 strBD = "00000000" 'No birthdate found so set to 8 spaces
66 Else
67 strBD = objdr.Item("BD") 'All ok so leave as is
68 End If
Here is the error I get:
System.InvalidCastException: Operator '=' is not defined for type
'DBNull' and string "".
at
Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual(Object
Left, Object Right, Boolean TextCompare)
at my_project.Form1.Button1_Click(Object sender, EventArgs e) in C:
\...\Form1.vb:line 64
I am sure I have used this before with no problems, so am a little
confused...
Any thoughts?
Thanks for your time.
64 If objdr.Item("BD") = "" Or objdr.Item("BD") Is DBNull.Value Then
'test to see if result is blank or null
65 strBD = "00000000" 'No birthdate found so set to 8 spaces
66 Else
67 strBD = objdr.Item("BD") 'All ok so leave as is
68 End If
Here is the error I get:
System.InvalidCastException: Operator '=' is not defined for type
'DBNull' and string "".
at
Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual(Object
Left, Object Right, Boolean TextCompare)
at my_project.Form1.Button1_Click(Object sender, EventArgs e) in C:
\...\Form1.vb:line 64
I am sure I have used this before with no problems, so am a little
confused...
Any thoughts?
Thanks for your time.