VB.NETでテキストボックスに値を入力してsqlサーバーのテーブル
を検索しようとしているのですが、実行時にシステムエラーになります。
SqlConnection2.Open()
selread = "select * from jyugyoin where (ncode=code.text)"
sda = New SqlClient.SqlDataAdapter(selread,SqlConnection2.ConnectionString)
sda.Fill(ds, "syain")
ncode=code.text を ncode = 1 とするとうまくいきます。
引用符か何かでかこまないといけないのでしょうか?
教えてください。
私の環境は.NETではないですが。
selread = "select * from jyugyoin where (ncode=code.text)"
↓
selread = "select * from jyugyoin where (ncode=" & code.text & ")"
ではどうなる?
匿名さん
ありがとうございました。うまくいきました。
ちなみに、このような情報はどこにあるのか教えて頂けると
ありがたいのですが・・・