J
JFB
Hi All,
In my function bellow I try to check for a null or empty value coming from
my database before I set my phone format.
Function Format(ByVal value As Object)
'LabelTest.Text = value
If (Not value Is DBNull.Value) And (value <> "") Then
Dim n As Long = Convert.ToInt64(value)
Return n.ToString("###-###-####")
End If
End Function
I have an error on If (Not value Is DBNull.Value) And (value <> "") Then:
System.InvalidCastException: Operator is not valid for type 'DBNull' and
string "".
How can I fix this?
Tks in advance
JFB
In my function bellow I try to check for a null or empty value coming from
my database before I set my phone format.
Function Format(ByVal value As Object)
'LabelTest.Text = value
If (Not value Is DBNull.Value) And (value <> "") Then
Dim n As Long = Convert.ToInt64(value)
Return n.ToString("###-###-####")
End If
End Function
I have an error on If (Not value Is DBNull.Value) And (value <> "") Then:
System.InvalidCastException: Operator is not valid for type 'DBNull' and
string "".
How can I fix this?
Tks in advance
JFB