Form1.stockCommand.Connection = requestConnection
Form1.stockCommand.CommandText = "Insert into UserOrders(TickerSymbol,DateTime,OrderType,StockQuantity,OrderStatus) Values('" &
Form1.StockComboBox.Text & "','" & Date.Today & "','" & Form1.TradeTypeComboBox.Text & "','" & Form1.QuantityTextBox.Text & "','PENDING')"
Dim numOfRecords As Integer = Form1.stockCommand.ExecuteNonQuery()
If numOfRecords = 1 Then
MsgBox("A new order has been added successfully")
Else
MsgBox("Failed to add a new order")
End If
更具体地说,VB.NET说"未处理的类型' System.Data.OleDb.OleDbException'发生在System.Data.dll
中附加信息:INSERT INTO语句中的语法错误。"
我的所有访问名称都对应于代码中的名称。
谢谢!