Dim CustID As String = txtSrchCustID.Text
Dim FirstName As String = txtNewCustFName.Text
Dim SecondName As String = txtNewCustSName.Text
If CustID And FirstName And SecondName = "" Then
MsgBox("Please enter a term to search by")
EndIf
这会返回“从字符串转换”到“长整型”无效。我想知道错误是什么以及如何修复它?我所看到的其他问题主要是与分配不正确类型的变量有关,但我认为这不是问题。它发生在所有变量都为空时。InvalidCastException未处理?
谢谢!
认沽期权严格在你的代码的顶部或设置在你的项目属性,它会帮助你抓住这些类型的错误。 – 2012-04-04 14:19:57
我已经这样做了,谢谢:) – Paul 2012-04-05 13:52:58