I'm using Linq-to-SQL and I just started to learn some of the basics. I have problem with select command many columns in many tables. I give songs which selected into session (contain songid) and display songname, artistname, genrename in datagrid.
But it's not working.
ArrayList SelectedSongs = (ArrayList)Session["SelectedSongs"];
string songIds = "";
foreach (int id in SelectedSongs)
songIds += id + ", ";
var query = from s in sa.Songs
from ar in sa.Artists
from g in sa.Genres
where s.SongID in (songIds)
select new { s.SongID, s.SongName, ar.ArtistName, g.GenreName };
dgSongs.DataSource = query;
Can anyone help me solve this problem. Thanks.