The error message is so clear that, if you don't fully understand it, you should really read on relational databases and ADO.NET pretty much from scratch, to understand just the basic ideas.
If you are using
ExecuteNonQuery
, it means that your SQL statement is supposed to modify some data in the database, but your is a
select
statement, that is, a pure query. Isn't that obvious: you are using
ExecuteNonQuery
with a query.
With a query, you should use
ExecuteReader
or
ExecuteScalar
, to have something to obtain the query results:
http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbcommand%28v=vs.110%29.aspx[
^].
—SA