Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql Parameters Problem
Message
From
02/01/2003 17:02:16
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Sql Parameters Problem
Miscellaneous
Thread ID:
00737516
Message ID:
00737516
Views:
58
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
Map
View

Click here to load this message in the networking platform