asp.net - Error about local variable in Entity Framework -
error message: local variable named 'e' cannot declared in scope because give different meaning 'e', used in 'parent or current' scope denote else. why i'm seeing error? how remove. please help. i'm new. happy see elaborate answer.
protected void buttondeleteprofile_click(object sender, eventargs e) { string inputstring; inputstring = textboxinputemployeeid.text; int inputemployeeid; int.tryparse(inputstring, out inputemployeeid); tbl_employee deleteprofile = new tbl_employee(); tbl_employee_education deleteeducation = new tbl_employee_education(); tbl_leaveapplication deleteapplication = new tbl_leaveapplication(); tbl_login deletelogininfo = new tbl_login(); deleteeducation = hrmsdb.tbl_employee.where(e => e.employeeid==inputemployeeid).firstordefault(); }
you've got method parameter called e
, can't introduce lambda expression parameter called e
. you'll need rename 1 of them.
as shorter example, show has nothing ef etc:
// invalid: same variable name twice void foo(string x) { action<int> action = x => {}; } // valid: different variable names static void foo(string x) { action<int> action = y => {}; }
Comments
Post a Comment