Hello,

I'm trying to run a query to populate a gridview control such that the contents of a textbox are used as a selectcommand. My code is as follows:
SelectCommand="SELECT [Organization],[Search Word 1] FROM [Main] WHERE [Search Word 1] = <%$ txtSearchWord01.Text %> ORDER BY [Organization]">

I get the following error:
ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '[Search Word 1] = <%$ txtSearchWord01.Text %>'.

I'm simply trying to get the contents of a textbox (txtSearchWord01) into the "Select" command of the query.
ANY help would be greatly appreciated.
Thank you in advance for your time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.