DataReader into object..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all.

I have a DataReader that its associated with a connection.

My query has results, and i have a class with the same fields name than the
table in the database...

I would like to know what its the best way to fill the properties of my
object with a datareader.

Thanks.
 
Hi Josema,

Do you want to fill the properties that represent field names
by DataReader?
To accomplish that you can cast your DataReader to IDataRecord
and then iterate through all field names.

If my answer is out of your problem then i think that you should
be more precise with your problem.

Regards!

Marcin
 
Your answer its exactly my problem, okay i will do that.

Thanks
Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top