'Why this error .. command text was not set to command object

conn.Open()

    Try
        Dim update As New OleDbCommand
        update.Connection = conn
        update.CommandText = " UPDATE O_name SET fname= '" & Name1.Text & "' WHERE ID = '" & ID.Text & "'"
        update.ExecuteNonQuery()
        MsgBox("done")
    Catch ex As Exception
        MsgBox(ex.Message.ToString)
    End Try

    conn.Close()

there is always Error " Command Text was not set to command object " what's the reason please don't talk about parametrized query cause i'm asking about this specifically



Solution 1:[1]

A quick google for the error message has a link to this page as the first search result, where someone writes:

The problem was EvaluateAsExpression was not set to true..its working now..thanks again for the help :)

What kept you from using Google and finding it as quicky as I did?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thorsten Dittmar