|
定义了个函数 Public Function RunCard_Query(ByVal strtype As String, ByVal strdate As String, ByVal strclass As String) As DataSet
Dim data As New DataSet()
dsCommand.SelectCommand = New SqlCommand("SELECT MAX(CAST(SUBSTRING(RUNCARD,2,9) AS INTEGER)) AS NUM FROM RUNCARD WHERE TYPE = '" + strtype + "' AND CLASSNAME = '" + strclass + "' AND RUNCARD LIKE '" + strdate + "' + '%'", con)
'dsCommand.SelectCommand = New SqlCommand("SELECT COUNT(*) AS NUM FROM RUNCARD WHERE TYPE = '" + strtype + "' AND CLASSNAME = '" + strclass + "' AND RUNCARD LIKE '" + strdate + "' + '%'", con)
dsCommand.Fill(data)
RunCard_Query = data
End Function
引用 ds = mySqlData.RunCard_Query("Wafer_Lot", strdate, "PRO")
Dim i As Integer
Dim j As Integer
i = ds.Tables(0).Rows(0)("num")
j = i + 1
……
结果运行就说从类型“DBNull”到类型“Integer”的强制转换无效,请高手指教,急!!!
|
|