General information
Title:
Sql Parameters Problem
Hi,
Using .net, Windows Forms, Vb and the sql wizards...
Trying to set sql parameters. I enter either a value or nothing into the TeSearchFileNum.Text TEXTBOX control field.
I get the error message:
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from string " " to type 'Integer' is not valid.
Dim intFileNum As Integer
Dim intFileNum As Integer
If TeSearchFileNum.Text Is Nothing Or TeSearchFileNum.Text Is "" Then
intFileNum = 0
Else
intFileNum = CInt(TeSearchFileNum.Text)
End If SqlDaListing.SelectCommand.Parameters("@FileNum").Value = intFileNum
FileNum is an int field in the sql table.
Does not seem to be comparing to nothing or "".
Any suggestions?
Thanks
Roland
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only