Hi,
i have generated a Linq to Sql class which looks like this.
so i have 3 querys which gets my data.
private IQueryable<Gesellschaft> loadedGesellschaft;
private IQueryable<Anschrift> loadedGesellschaftAnschrift;
private IQueryable<Email> loadedGesellschaftEmail;
private lgDataContext completeGesellschaft;
private void Button_Click(object sender, RoutedEventArgs e)
{
completeGesellschaft = new lgDatacontext();
loadedGesellschaft = completeGesellschaft.Gesellschaft.Where(gid => gid.GID == 2);
loadedGesellschaftAnschrift = completeGesellschaft.Anschrift.Where(FK_GID => FK_GID.FK_GesellschaftId == loadedGesellschaft.First().GID);
loadedGesellschaftEmail = completeGesellschaft.Email.Where(FK_GID => FK_GID.FK_AnschriftId == loadedHauptanschrift.First().idAnschrift);
}
After this i want to put these 3 on my page. The Result is something like this there one Office(loadedGesellschaft) and that has maybe more than one Adress(loadedGesellschaftAnschrift) and has maybe more than one Email(loadedGesellschaftEmail) so i have on my window some textboxes which contain the fields from loadedGesellschaft and Adresses and Emails are stored in comboboxes.
do i always have to bind the itemsource of one Control e.g.
<ComboBox Name="CBox_GDEmail" />
CBoxGDEmail.Itemsource = loadedGesellschaftEmail;
or is there an possibility to put all three objects together to the datacontext of the window ?