我正在使用以下代码将记录从另一个表插入到一个表中......
Private Sub InsDuplicateDB()
Dim strInsDup As String = "INSERT INTO Duplicate_srno(Sr_no,chalan_no) SELECT sr_no,chaln_no FROM Vendor_Machine where sr_no=@srno"
Dim comm_InsDup As OleDb.OleDbCommand = New OleDb.OleDbCommand(strInsDup, cnnOLEDB)
comm_InsDup.Parameters.AddWithValue("@srno", cmbSn_no.Text)
comm_InsDup.ExecuteNonQuery()
Dim strUpdDup As String = "UPDATE Duplicate_srno SET sr_no = @srno,chaln_no =@chn_no,Problem=@problemWHERE sr_no = @srno AND chalan_no=@chn_no"
Dim comm_Update As OleDb.OleDbCommand = New OleDb.OleDbCommand(strUpdDup, cnnOLEDB)
comm_Update.Parameters.AddWithValue("@srno", cmbSn_no.Text)
comm_Update.Parameters.AddWithValue("@chn_no", cmbChal_no.Text)
comm_Update.Parameters.AddWithValue("@problem",strProb)
comm_Update.ExecuteNonQuery()
End Sub
这里 strProb 是一个字符串,其值在另一个子函数中分配。这里它给出错误为“没有为一个或多个必需参数提供值..”
请解决我的问题