استفاده از Storedprocedure در EntityFrameWork
سلام
من این Stored procedureرو نوشتم که یک خروجی داره ودر دات نت Import Function ساختم به اسم Fn_login:
کد:
ALTER Procedure [dbo].[LoginResult]
@userName nchar(10),
@passWord nchar(15),
@accessLevel nchar(15) output
as
SET @accessLevel =(Select accessLevel from dbo.Login Where employeeID=@userName And password=@passWord)
return @accessLevel
ودر دات نت هم کد زیر را نوشتم:(Entity اسم EntityFrameWork که ساختم)
کد:
using (Entity d = new Entity())
{
var outPut = new ObjectParameter("accessLevel", typeof(String));
d.Fn_login("123", "123", outPut);
a = (outPut.Value).ToString();
return a;
}
ولی ارور میده:(خیلی سرچ کردم نتیجه نداشت):41:
کد:
The data reader returned by the store data provider does not have enough columns for the query requested.