Hi Im trying to access a database table in my mvc4 application using a stored procedure and Entity Framework 5.
I created a FormValueModel.edmx file and imported the User Table and the GetUser Stored Procedure
Here is the code for the GetUser Stored Procedure
SELECT
*
FROM
[User].[User]
Where
@UserName = UserName
AND @UserPassword = UserPassword
AND Active = 1
Here is the code in my Controller to access the stored procedure
using (var db = new FormValueEntities())
{
string userName ="TestUser"
string password = "Password"
var query = db.GetUser(userName, password);
}
Why cant I access the table by using query.UserName or query.UserPassword ect.
Thanks in advance
You need to take the first item from the query i.e.