That would be a constructor and for some cases I preffered to create a new get and set for each of them. I really appreciate your fast answer but my question is not about how I have to build my class. My question is about database. How do I use database fields and convert them in to arguments for my method. Even using your suggestion, is the same for me. What you wrote:
Code:
public InitializeIndividual( int anId, string aFirstName, string aLastName, string anExistingRelation, ... )
{
id = anId;
name = aFirstName;
lastName = aLastName;
existingRelation = an ExistingRelation;
...
}
...
Foo Bar = new Foo();
Bar.InitializeIndividual( 1, "Bob", "Barker", ... );
It's just the same. I just want this part not been hard coded:
Code:
Bar.InitializeIndividual( 1, "Bob", "Barker", ... );
I want that, besides of "Bob", "Barker" and that kinds of hard coded arguments, I want to pass database fields through it. Example:"
Code:
Bar.InitializeIndividual( 1, "Table.Field X, "variableMadeFromDataBaseField", ... );
Is that even possible? It has to be. I repeat, many thanks but I don't want to write my arguments. I want to take them from a data base. How I do that?????