In web application, I am using LINQ to call a procedure, the procedure is parameter procedure. but when I am passing arguments it is giving errors, This is my code:
MyLinqsDataContext DataContext=new MyLinqsDataContext ();
int eno=Convert.ToInt32 (txtempno.Text );
int dep=Convert .ToInt32 (txtDep.Text );
var sqr = from qr in DataContext.USP_Insert_Emp(eno, txtName.Text, dep)
select qr;
But is giving error like:
Could not find an implementation of the query pattern for source type
int.Selectnot found.
This is my Proc :
create procedure USP_Insert_Emp(@empid int,@ename varchar(60),@deptid int)
as
begin
insert into Emp (empid ,ename,deptid ) values (@empid ,@ename ,@deptid)
end
DataContext.USP_Insert_Empreturns anint.The error you are getting is because you are trying to call
Selecton anintand not anIEnumerable<T>.