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
Loading
Amit ChoudharyPosted Jul 20, 2011, 5:48 AM
PhototGalleryBindingSource.DataSoruce = db.photogalleries.select(photo=> photo.Name, Photo.Title, Photo.AlbumCol.AlbumName,..,..,);
Here Photo.AlbumCol is the column of album that is appearing in the phototable. Select any column you want in your datasource like this.
Hope this helps you.
Thanks