C
Chris Dunaway
I have a table in the database called Users and it has typical fields
(UserId, UserName, etc.).
I created a User class with properties that match the fields in the table.
What I want to do is read a row from the table and create an instance of
the User class, populated with the data from that row.
I can manually set the values of each property in the class from a
DataReader for example, but I was wondering if there was an easier way to
do it.
Is there a way to read a row "directly into" and object instance? Or must
I just bite the bullet and do it manually?
Or am I completely off on the wrong tangent?
(UserId, UserName, etc.).
I created a User class with properties that match the fields in the table.
What I want to do is read a row from the table and create an instance of
the User class, populated with the data from that row.
I can manually set the values of each property in the class from a
DataReader for example, but I was wondering if there was an easier way to
do it.
Is there a way to read a row "directly into" and object instance? Or must
I just bite the bullet and do it manually?
Or am I completely off on the wrong tangent?