transfer datas from a table into an Object [modified]
-
Hallo, I am completely new in ASP.Net and I want to pass the data from a simple SELECT into the Attributes of an Object. The Class has similar attributes as the DB-Table. Where should I look to learn how to do that? Is there already a standard procedure (presumably Microsoft's) for such a process? Thanks in advance.
modified on Monday, February 7, 2011 2:18 PM
-
Hallo, I am completely new in ASP.Net and I want to pass the data from a simple SELECT into the Attributes of an Object. The Class has similar attributes as the DB-Table. Where should I look to learn how to do that? Is there already a standard procedure (presumably Microsoft's) for such a process? Thanks in advance.
modified on Monday, February 7, 2011 2:18 PM
There is no standard procedure for this. You could do it by hand, such as:
SqlDataReader dr = ... while(dr.Read()) { MyObject obj = new MyObject(); obj.Property1 = dr["Property1"]; ... }
or use an Object Relational Mapping tool such Entity Framework, or create your own
I know the language. I've read a book. - _Madmatt