System.Data.SQLite select命令中的逻辑错误

时间:2014-06-16 12:24:12

标签: sqlite system.data.sqlite

我有以下select命令:

        Dim nCmdSel As SQLite.SQLiteCommand = cnApp.CreateCommand
        With nCmdSel
            .CommandText = "SELECT word, priority FROM mf WHERE word LIKE " & _
                "@word% " & _
                "ORDER BY priority DESC LIMIT 100"
            .Parameters.Add("@word", DbType.String).Value = sThisWord 
        End With
        r = nCmdSel.ExecuteReader()

我收到错误

"SQL logic error near ORDER:"

但我不知道我犯了什么错误。 有人看到了吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

知道了:

我需要这样做:

.Parameters.Add("@word", DbType.String).Value = sThisWord & "%"