0
次のコードは2番目の文で変換例外を指定しています。文字列 "select CustName from tblCustMst"から "整数"への変換は無効です
Dim query As String = "select CustName from tblCustMst " & "where [email protected]"
cmd.CommandType = query
次のコードは2番目の文で変換例外を指定しています。文字列 "select CustName from tblCustMst"から "整数"への変換は無効です
Dim query As String = "select CustName from tblCustMst " & "where [email protected]"
cmd.CommandType = query
あなたはcmd.CommandText
を使用する必要があります。
Dim query As String = "select CustName from tblCustMst " & "where [email protected]"
cmd.CommandText= query
幸運:
はこれを試してみてください。
です。問題はCommandTypeにクエリを割り当て、 CommandText私は彼の問題を修正した –
2番目の文でエラーが発生します –
CommandTypeにクエリを割り当てません。 CommandTypeはhttps://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtype(v=vs.110).aspx –