使用oledbcommand类问题?
下面代码怎么不能实现删除选中的项?
cmd.executenonquery()语句出错,提示如下:
未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中。
Dim dad As New OleDb.OleDbDataAdapter
Dim ds As New System.Data.DataSet
Dim cmd As New OleDbCommand
Dim str As String = "delete from title where pernodes='" & ComboBox1.Text & "' and chinodes='" & ComboBox1.Text & "'"
cmd.Connection = OleDbConnection1
cmd.CommandType = CommandType.Text
cmd.CommandText = str
OleDbConnection1.Open()
cmd.ExecuteNonQuery()
OleDbConnection1.Close()