Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to pass Parameters and Stored Procedure using Linq

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 778
    Comment on it

    How to pass Parameters and Stored Procedure using Linq

    ExecuteFunction executes stored procedure with specified parameters.This function accepts 2 parameters i.e stored procedure name and parameter list.

    public List<GetCustomerSearchResult_Result> SearchCustomerMobileList(Int32 cbstr, string txtstr, int minLimit, int maxlimit)
    
        {
            var pars = new ObjectParameter[] {new ObjectParameter (@"criteria", cbstr), new ObjectParameter(@"searchValue", txtstr)
                            , new ObjectParameter(@"MinLimit", minLimit), new ObjectParameter(@"MaxLimit", maxlimit)};
            return objPHQEntities.ExecuteFunction<GetCustomerSearchResult_Result>("GetCustomerSearchResult", pars).ToList<GetCustomerSearchResult_Result>();//GetCustomerSearchResult is stored procedure name and pars is a parameter list
        }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: