Hi.
I guess this is a very simple question, but really cant fint the answer that suits my needs!
What I have is 2 tables in a MySQL database:
Families
- FamilyId
- City
- Phone
Members
- FamilyId
- Birtdate
The family id is of course the primary key, that binds members to a family.
So what I want is to get the right family row, and all member rows that belongs to this family like this:
string Query="SELECT * FROM `Families`, `Members` WHERE `Families`.`FamilyId`='132' AND `Members`.`FamilyId`='123';";
But how do I iterate over the result, so that I can create the corresponding family object, and the corresponding Member objects that I have in my C# application?
MysqlConnection.Open();
MySqlCommand MysqlCommand=new MySqlCommand(Query,MysqlConnection);
MysqlReader=MysqlCommand.ExecuteReader();
while (MysqlReader.Read()) {
//what should I do here?
}