我尝试为SQLite DB编写下面的代码,但是我得到了Params.ForEach(Sub(x) SQLCmd.Paramas.Add(x))
中带有Sub Underlined的错误站表达式。我试图找出问题但是,我知道VB2008中的编译器有错误。请任何人帮我解决此问题,或建议我使用上述行的替代代码
Public Sub ExecQuery(ByVal Query As String)
Try
SQLcon.Open()
SQLCmd = New SQLiteCommand(Query, SQLcon)
Params.ForEach(Sub(x) SQlCmd.Parameters.Add(x))
Params.Clear()
SQLDS = New DataSet
SQLDA = New SQLiteDataAdapter(SQLCmd)
RecordCount = SQLDA.Fill(SQLDS)
SQLcon.Close()
Catch ex As Exception
Exception = ex.Message
End Try
If SQLcon.State = ConnectionState.Open Then SQLcon.Close()
End Sub