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

  • Home
  • SEARCH
  • 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 146467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:36:30+00:00 2026-05-11T08:36:30+00:00

I have this Linq to SQL query sequence that is basically returning a search

  • 0

I have this Linq to SQL query sequence that is basically returning a search on a table called PROJECTS. and I’m taking advantage of the deferred execution to slowly build it up.

var query = from p in objDBContext.PROJECTs where (p.PROVIDER_ID == cwForm.productForm)  select p;   query = from p in query where p.SubmittedDate >= cwForm.beginDateForm select p; 

I wrote a few SQL functions that return scalar values and table values as helper function because LINQ doesn’t support ISDATE() or full text search. they are in the same .dbml file as the Projects table.

So now I have:

var dateQuery = from d in objDBContext.ISDATE    select d; //returns a bool  var ftsQuery = from f in objDBContext.FullTextSearch select f; //returns a valued-table with the primary keys of hits with fulltextsearch 

My question is, how do I use these new objDBContexts on the original query p? I’m also interested in figuring out how to map an executequery() back into the original query.

Something like:

query = from p in query         from d in dateQuery         from f in ftsQuery where d.ISDATE(p.Field1) &&  f.FullContextSearch(searchString)          select p;  

I hope that makes sense. I’ve got a few types mismatched errors and have tried googling for a while but couldn’t find anything.

  • 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. 2026-05-11T08:36:31+00:00Added an answer on May 11, 2026 at 8:36 am

    Since you have defined all your methods on the context class, use the same instance for all three:

    var query = from p in objDBContext.Projects where     p.PROVIDER_ID == cwForm.productForm      && objDBContext.ISDATE(p.Field1)     && objDBContext.FullTextSearch(searchString)         //assuming FullTextSearch returns boolean     select p 

    if FullTextSearch doesn’t return boolean, you need to build an expression that does. Like if it returns IList, you could do objDBContext.FullTextSearch(searchString).Contains(p)

    Though keep in mind what you’re trying to do will cause three round-trips to the database no matter which way you cut it. It might be better just to hand-craft your SQL in this case. LINQ to SQL cannot, and is not intended to, replace SQL 100% of the time.

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

Sidebar

Ask A Question

Stats

  • Questions 115k
  • Answers 115k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not aware of any way to measure the contents… May 11, 2026 at 10:28 pm
  • Editorial Team
    Editorial Team added an answer You are looking for the call method: function onClick() {… May 11, 2026 at 10:28 pm
  • Editorial Team
    Editorial Team added an answer Core Plot There's a plotting framework in active development on… May 11, 2026 at 10:28 pm

Related Questions

I have a linq to sql database. Very simplified we have 3 tables, Projects
I'm stuck on translating a left outer join from LINQToSQL that returns unique parent
i get this error {Method 'System.DateTime ConvertTimeFromUtc(System.DateTime, System.TimeZoneInfo)' has no supported translation to SQL.}
I have a Linq to SQL query that was working just fine with SQL

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.