下面的代码在第二条语句中给出了Conversion异常。

 Dim query As String = "select CustName from tblCustMst " & "where PlantId=@PlantId"
 cmd.CommandType = query

最佳答案

您应该使用cmd.CommandText
尝试这个:

Dim query As String = "select CustName from tblCustMst " & "where PlantId=@PlantId"
cmd.CommandText= query


祝好运。

10-08 04:43