Evaluate NULL Sql Output paramaters
How do you evalute a null sql output paramater. I've tied several ways but can find one that works. I always get an error code of Conversion from type 'DBNull' to type 'String' is not valid.
I've tried both IsDbNull and if the value = nothing - both return the same error.
Can anyone help me figure this one out? It has to be something simple!
Code:
If IsDBNull(e.Command.Parameters("@JobCount")) Then
Me.lblInternalJobCount.Text = 0
Else
Me.lblInternalJobCount.Text = e.Command.Parameters("@JobCount").Value
End If
'I have also tried checking for nothing and that doesn't work either
Re: Evaluate NULL Sql Output paramaters
Quote:
If IsDBNull(e.Command.Parameters("@JobCount")) Then
The above code checks if the Parameter Object is DBNull
It should check if the Parameter's Value is DBNull
Code:
If IsDBNull(e.Command.Parameters("@JobCount").Value) Then
Re: Evaluate NULL Sql Output paramaters
Hey,
Yip, as Bruce as said. Here is the documentation:
http://msdn.microsoft.com/en-us/libr....isdbnull.aspx
Gary