return student station on logging [Resolved]

Posted by Jopito under ASP.NET on 12/17/2013 | Points: 10 | Views : 1111 | Status : [Member] | Replies : 1
Hellow pals,i have a table with columns StudentUserId,StudentId,userId and StationId whereby i need a method to return for me the object StationId for based on the StudentId and UserId whereby when th user logs in,he is identified by his Id and can only see records concerning him.Have created a method here but i acnt figure where an getting wrong as it does not return any values
public void GetStationByUserId(int StudentId,Guid StationId)
{

var query = from Students in db.StudentsUsers
where students.studentId == StudentId
where students,StationiD==stationId
select students;

return;
}

Mark as answer if satisfied


Responses

Posted by: vishalneeraj-24503 on: 12/17/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Why are you sending GUID as parameter in function, please take string or integer datatype.

public void GetStationByUserId(int StudentId,Int StationId)
{

var query = from Students in db.StudentsUsers
where students.studentId == StudentId
where students,StationiD==stationId
select students;

return;
}

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response