Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:19:53+00:00 2026-06-10T11:19:53+00:00

I am working at implementing a search feature into my MVC3 application. I’m looking

  • 0

I am working at implementing a search feature into my MVC3 application. I’m looking to pass two parameters into and execute a stored procedure that will look basically something like this:

create procedure MyProc
(
@FirstParam nvarchar(50),
@SecondParam nvarchar(20)
)
as select * from MyTable where @FirstParam like @SecondParam
  • MyTable has about 30 fields that will be returned for each object and I need to create a procedure like this for several tables, so I am trying to avoid using a SqlDataReader and converting the returned Sql data to C#.
  • I would like to use something like this method but I am not sure if this can be done with multiple parameters.
  • Ideally I would like to use EF4, but I have not found any good information on executing stored procedures while using EF4.

Any insight on the most painless way and/or best practice for executing this task will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:19:55+00:00Added an answer on June 10, 2026 at 11:19 am

    My sugestion is use dynamic linq (and here, and here). You can pass valid linq expressions as regular strings:

    var column = "Name";
    var value = "Marvin";
    var query = DbCtx.MyEntity.Where("{0} == @1", columnName, value);
    

    The benefits (IMO) is that you can keep the search logic in the application and, if you need to do this for many tables, you can create a T4 template to generate the bootstrap code for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on implementing dynamic loading of Pages into a existing Silverlight application. So
Hello I am currently working on implementing a spatial search feature for a website
I am looking for suggestions and working sample for implementing Faceted Search using Spring
I'm implementing a basic search feature for a site I'm working on. The cleanest
I'm currently working on implementing a fulltext search engine for one of our sites,
I'm working on implementing a single pass depth-peeling algorithm by using atomic textures in
I'm working on implementing a reasonably simple XML serializer/deserializer (log file parser) application in
I am implementing mobile local search in iPhone application: - (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText
I'm working on implementing a feed generator for use with Google Product Search for
We're working in EFv1 and I'm implementing a search control with several filter options.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.