none
put the columns to my class definitions RRS feed

  • Question

  • Hello,

    I have a class
    and a bunch of fields declared

    private string id;
    private string name;
    private string contact;
    etc...

    I want to create a Load() function that will
    select * from a table

    and put the values in my variables so
    this.id=row[id]
    this.name=row[name]
    this.contact=row[contact]

    I want to automate this. I mean all SQL table table columns will go to a field.
    how can I do this via a loop or something else?

    Thanks
    Sunday, March 2, 2008 4:05 PM

Answers

All replies