How to get query result from Access

  • Thread starter Thread starter Joe Au
  • Start date Start date
J

Joe Au

I create oledbcommand to query Access database e.g. (select
accno,accname,email from account ...). If I use ExecuteScaler, I get only
accno. If I use ExecuteNonQuery, it does not work. Of course, I can use
ExecuteReader. But, can I do with ExecuteNonQuery?
Thanks.
Joe.
 
Hi Joe,

Joe Au said:
I create oledbcommand to query Access database e.g. (select
accno,accname,email from account ...). If I use ExecuteScaler, I get only
accno. If I use ExecuteNonQuery, it does not work. Of course, I can use
ExecuteReader. But, can I do with ExecuteNonQuery?

No, why? Execute*Non*Query implies that it executes non-select commands.
Why don't you just use a dataadapter and fill a datatable?
 
Back
Top