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 7847015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:46:09+00:00 2026-06-02T17:46:09+00:00

I have an application that does a search of our database (exposed via EF)

  • 0

I have an application that does a search of our database (exposed via EF) for records meeting certain conditions. We have two main tables (Jobs and Recipients). Recipients are linked to the Jobs table by a Job ID.

The job record has various fields (Process Date, Name, JobType). The recipient has a lot of Name and ID fields (e.g. Account Number, Surname, etc)

I want to present a search screen where they see a list of fields to search on. The ASP.net code then sees which textboxes the user typed in (or selected), and builds a query based on that.

I’m just trying to find the most efficient way possible.

The rough logic is :

    if not string.isnullorempty(txtName.text) then
        'Query.Where.Add clause = " AND Name like '@txtName'
        'Query.WhereParameters.Add("@txtName",txtNAme.text
    end if

if not string.isnullorempty(txtAccountNumber.text) then 

.....etc


 if not string.isnullorempty(txtFromDate.text) then..

Where I’m stuck is figuring out how to add in additional where clauses. Should I just use Entity SQL?

Can this return strongly typed EF objects as well? And is it possible to return both the Jobs and Recipients objects?

e.g. if I did a select recipient., jobs. from….blah would this parse correctly and return linked Recipient and Job objects?

  • 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-02T17:46:10+00:00Added an answer on June 2, 2026 at 5:46 pm

    If you start from a strongly-typed unfiltered query, you can add filters using Queryable.Where.

    Name = txtName.Text
    If Not String.IsNullOrEmpty(Name) Then
        Query = Query.Where(Function(j) j.Name.Contains(Name))
    End If
    

    If your unfiltered query correctly links multiple records, those links will be preserved when you add a filter.

    (Disclaimer: I don’t usually use VB.NET; there may be silly syntax errors, but you should be able to get the general idea.)

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

Sidebar

Related Questions

We have a bug in our application that does not occur every time and
I have an application that stores data in database. I need search functionality to
i have an Java J2ME application that does (at user request) create HttpConnections to
I have a simple test application (C# console application) that does an HTTP GET
I have just been involved in writing an application that does not use Doctype's
I have a Visual Studio 2008 C++ application that does something like this: template<
I have a web application build on PHP that (does some processing and) displays
Does MS have a sample enterprise application that demonstrates the use of different Enterprise
We have built a web application that accepts SOAP messages, does some processing, calls
I have an application (winform exe) that I run several times. Does this mean

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.