List:MySQL and .NET« Previous MessageNext Message »
From:Jordan Sparks Date:October 6 2004 3:45pm
Subject:RE: Better way to get all columns in the DataReader
View as plain text  
I have thought about writing a generic class to fill any of my classes
from their corresponding database table.  It would involve Reflection
and attributes on each of my classes and members.  The attributes would
tell this generic class which table and column match this class and
member.  But maybe I have avoided it because I don't want my code to
look TOO much like C#.  I still want to be able to rewrite it easily
when the next great programming language comes out.

Jordan Sparks
 

-----Original Message-----
From: Guy Platt [mailto:guy@stripped] 
Sent: Wednesday, October 06, 2004 8:30 AM
To: Jordan Sparks
Cc: dotnet@stripped
Subject: Re: Better way to get all columns in the DataReader


Jordan,

Thanks for your code sample.

Jordan Sparks said the following wise words on 2004-10-06 5:14 PM:

>Separate your data connection into a separate object.  All classes in 
>your program then use this one object.  So you have only one place in 
>the entire
>

Actually that is what the example code I sent is from, however since I 
have several database tables I wanted to see if there was a better way 
of doing the DataReader to Class assignment than the way I am doing it.

regards
  Guy


Thread
Return parameter from query.Asbjørn Konstad24 Sep
  • Re: Return parameter from query.Fredrick Bartlett26 Sep
  • RE: Return parameter from query.Reggie Burnett26 Sep
    • Better way to get all columns in the DataReaderGuy Platt6 Oct
      • RE: Better way to get all columns in the DataReaderJordan Sparks6 Oct
        • Re: Better way to get all columns in the DataReaderGuy Platt6 Oct
          • RE: Better way to get all columns in the DataReaderJordan Sparks6 Oct
          • Re: Better way to get all columns in the DataReaderBarry Zubel6 Oct
    • Re: Better way to get all columns in the DataReaderFredrick Bartlett6 Oct