DataClassesDataContext MyDB = new DataClassesDataContext();
var id = from wineT in MyDB.Wineries
where wineT.wineryID==Convert.ToInt32(
from w in MyDB.WineTypes
where w.kind==ddlSorti.SelectedItem.Text
select w.wineryID)
select wineT.name;
GridView1.DataSource = id;
GridView1.DataBind();
I have this code and I don’t have any errors, but when I start the application I get this error “Could not format node ‘ClientQuery’ for execution as SQL”.
You need to add
FirstOrDefault()in your sub select