class Company
{
public string Name { get; set; }
public List Loans { get; }
// The other properties / columns goes here...
// Constructor
public Company()
{
this.Loans = new List();
}
}
class Loan
{
public string CompanyName { get; set; }
// The other properties / columns goes here...
}
static class Main()
{
Dictionary companies = new Dictionary();
foreach (DataRow row in companyDataSet.Tables\["Company"\].Rows)
{
Company current = new Company();
current.Name = row.CompanyName;
// Fill here the other properties...
}
foreach (DataRow row in loanDataSet.Tables\["Loan"\].Rows)
{
Loan currentLoan = new Loan();
currentLoan.CompanyName = row.CompanyName;
// Fill here the other properties...
companies\[currentLoan.CompanyName\].Loans.Add(currentLoan);
}
// FillGridViewWithDictionary(companies)...
}