Sivakumar

Sivakumar

  • NA
  • 551
  • 219.5k

System.InvalidOperationException' occurred

Aug 25 2015 8:27 AM
Hi,
I Get a Error Like this :
System.InvalidOperationException' occurred in System.Data.Linq.dll but was not handled in user code
Additional information: The required column 'TeamID' does not exist in the results.
i want to get team member details based on teamid
this is my tables :
this is my stored procedure :
GO
ALTER PROCEDURE [dbo].[uspGetAllTeamMembers](@TeamID INT)

AS

BEGIN


SELECT m.MemberID,

m.MemberName,

m.MemberStatus,

ml.MemberLoginName,

tm.MemberJoinedDate,

tm.MemberLeftDate


FROM TeamMember tm

INNER JOIN MemberLogin ml

ON tm.MemberLoginID = ml.MemberLoginID

INNER JOIN Member m

ON m.MemberID = ml.MemberID

WHERE tm.TeamID = @TeamID


END
and this is my backend code :
public TeamMemberData GetAllTeamMembers(int teamid)
{
TeamMember getteammember = _DataContext.uspGetAllTeamMembers(teamid).SingleOrDefault();
return new TeamMemberData { MemberLoginID=getteammember.MemberLoginID};
}
I'm using linq to sql stored procedure
please give a help

Answers (3)