B
Beringer
Hello,
I am trying to make a query against an Access Database File using OleDb part
of the framework.
I created an SQL Query string using Access and it will execute the query
successfully in example SQL statement below:
SELECT * FROM myTable WHERE column1 Like "mytext*";
Now when I take that command and place it in an OleDbCommand as follows:
command.CommandText = "SELECT * FROM myTable WHERE column1 Like 'mytext*'";
And then execute a datareader with that command, the result is an empty set.
I've tried removing the single quotes " ' " from around the wildcard (i.e.
command.CommandText = "SELECT * FROM myTable WHERE column1 Like mytext*"
and that generates an exception at run time.
Any ideas?
I have done similar queries using the SQL part of the framework and that
works ok for instance:
command.CommandText = "SELECT * FROM myTable WHERE column1 Like 'mytext%'";
works when the command is a SqlCommand.
Thank you in advance,
Eric
I am trying to make a query against an Access Database File using OleDb part
of the framework.
I created an SQL Query string using Access and it will execute the query
successfully in example SQL statement below:
SELECT * FROM myTable WHERE column1 Like "mytext*";
Now when I take that command and place it in an OleDbCommand as follows:
command.CommandText = "SELECT * FROM myTable WHERE column1 Like 'mytext*'";
And then execute a datareader with that command, the result is an empty set.
I've tried removing the single quotes " ' " from around the wildcard (i.e.
command.CommandText = "SELECT * FROM myTable WHERE column1 Like mytext*"

and that generates an exception at run time.
Any ideas?
I have done similar queries using the SQL part of the framework and that
works ok for instance:
command.CommandText = "SELECT * FROM myTable WHERE column1 Like 'mytext%'";
works when the command is a SqlCommand.
Thank you in advance,
Eric