I want to get a value from a Linq query, e.g. I have a database called Team, I retrieve a certain team using the teamId, and then I want to assign the team name to a string...is this possible?
I have the query working to retrieve the team, it is as follows:
private Team getTeam(int teamId)
{
return (from t in db.Team where t.TeamId == teamId select t).Single();
}
Is it possible to use the above to assign any of the values retrieved to string? e.g. something like...
string teamName = getTeam(1).teamName.toString();
I know this isnt right but is something like this possible?
Any help will be much appreciated.

New Topic/Question
Reply




MultiQuote



|