table1データをtable2にコピーしようとしている挿入クエリが1つあります。今、クエリは、私が直接MySQLの中で実行すると正常に動作しますが、私は「VB.Net経由MySQLでクエリが実行されているのに、デバッグ中にVB.NETでエラーが発生する
INSERT INTO newMedicinesOrders (`OrderID`,`medicineName`, `power`, `form`, `fQuantity`, `iQuantity`, `type`, `cost`, `prescriptionLink`, `userID`) SELECT `orderID`, `name`, `power`, `form`, `fQuantity`, `iQuantity`, `type`, `mrp`, `prescriptionLink`, `userID` from myCart WHERE userID = '1'
をデバッグしようとしたとき、私は「フィールドリストに
不明な列を 『のorderID』というエラーメッセージが表示されます「
VBコード
Try
Dim str1 As String = "INSERT INTO newMedicinesOrders (`OrderID`,`medicineName`, `power`, `form`, `fQuantity`, `iQuantity`, `type`, `cost`, `prescriptionLink`, `userID`) SELECT `orderID`, `name`, `power`, `form`, `fQuantity`, `iQuantity`, `type`, `mrp`, `prescriptionLink`, `userID` from myCart WHERE userID = '" + userid.Text + "'"
Dim str2 As MySqlDataReader
Dim adapter As New MySqlDataAdapter
Dim command As New MySqlCommand
command.CommandText = str1
command.Connection = con
adapter.SelectCommand = command
con.Open()
str2 = command.ExecuteReader
con.Close()
Response.Write("<script language='javascript'>alert('Success.');</script>")
Catch ex As Exception
Response.Write(ex)
End Try
@eggyal「フィールドリスト」で「未知の列 'orderID'」と表示されます。 –
このクエリを呼び出すコードはvb 。ネット? – eggyal
@eggyalデバッグモードのスクリーンショットを表示しても問題ありませんか? –