I got three tables to join named Books, Borrowers and Transactions. The database scheme is as below:
- Books(BookID,BookName,ISBN);
- Borrowers(BorrowerID,BorrowerName,BorrowerLevel);
- Transactions(TransactionID,BorrowerID,BookID,BorrowDate,ReturnDate);
The corresponding class are Book, Borrower and Transaction respectively. Now i would like to select BookID,BookName,BorrowerID,BorrowerName,BorrowDate and ReturnDate from these three tables and to show in a listview having gridview control. XAML Code :
<Grid>
<ListView Margin="15,57,58,57" Name="borrowedBookList" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding }" KeyDown="borrowedBookList_KeyDown">
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Width="80" Header="Borrower ID" DisplayMemberBinding="{Binding Path=BorrowerID}"/>
<GridViewColumn Width="220" Header="Borrower Name" DisplayMemberBinding="{Binding Path=BorrowerName}"/>
<GridViewColumn Width="220" Header="Book Name" DisplayMemberBinding="{Binding Path=BookName}"/>
<GridViewColumn Width="100" Header="Date" DisplayMemberBinding="{Binding Path=BorrowDate}"/>
<GridViewColumn Width="100" Header="Return Date" DisplayMemberBinding="{Binding Path=ReturnDate}"/>
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</Grid>
Now how can i join these tables and assign the result datacontext into borrowedBookList?
Thankyou
Arefin Sami