下面的代码在第二个声明中给出了转换异常。
Dim query As String = "select CustName from tblCustMst " & "where PlantId=@PlantId"
cmd.CommandType = query
答案 0 :(得分:1)
您应该使用cmd.CommandText
试试这个:
Dim query As String = "select CustName from tblCustMst " & "where PlantId=@PlantId"
cmd.CommandText= query
祝你好运。