LINQ: Show parent table value in child table Gridview using Databinding Source
hello,
i have two tables containing a picture gallery
1. Album (parent) 2. Photo (child)
i want to show 'photo table' into gridview using a binding source. but 'photo table' show last column (which is the foreign key) as an object of 'Album table'. it is one of the property of LINQ. but how can i show only a single value (i.e: album name) from parent table (Album) into child table's gridview (Photo).
my current code is
[code]/*
photogalleries is my photo table
and gridview attached to bindingsource
*/
private void Gallery_Load(object sender, EventArgs e)
{
TestAppDBDataContext db = new TestAppDBDataContext(AppConn.AppConnection);
photogalleryBindingSource.DataSource = db.photogalleries;
}[/code]
kindly help me!!
Regards,
Raza us Samad