I want to set a label's text equal to a value I return from a LINQ query, as follows:
Dim dc As New alumniDataContext
Dim data As tblReunion_Info
lbl = Util.FindChild(Page, "lblEntry")
data = (From r In dc.tblReunion_Infos _
Where r.ReunionIndex = Request.QueryString("index") _
Select r.ReunionYear, r.ReunionIndex)
lbl.Text = data.ReunionYear
Following is the error I receive, which obviously means that I have to do some converting somewhere. Your help will be appreciated.
Unable to cast object of type 'System.Data.Linq.DataQuery`[System.String,System.Int32]' to type 'tblReunion_Info'."