1
Answer

LINQ: Show parent table value in child table Gridview using Databinding Source

Raza us Samad NA

Raza us Samad NA

13y
3.2k
1
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
Answers (1)