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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:55:38+00:00 2026-05-25T22:55:38+00:00

I am trying to import data into a new database, but some of the

  • 0

I am trying to import data into a new database, but some of the columns in the old database are null.

In one of my methods, I am using the query below to get the records, like I said already there is a column in the rows which has a null value for some records.

Guid nameGuid= new guid('CCECE54B-EE14-4463-8A0B-02C72679334A')

MySubQuery = from a in MainQuery
              where a.Table1.Id.Equals(nameGuid)
        Select a;

I want to check for a.Table1.Id value, if it is equal to null, then I still want the row but ignore the where condition.

Any suggestion for using the ternary operator in Linq query or any other approaches for my task.

  • 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-05-25T22:55:39+00:00Added an answer on May 25, 2026 at 10:55 pm

    Sounds like you want:

    MySubQuery = from a in MainQuery
                 where a.TableId.Id Is Nothing OrElse a.Table1.Id.Equals(nameGuid)
    

    That’s assuming my VB is correct… in C# I’d just write:

    var query = from a in mainQuery
                where a.TableId.Id == null || a.TableId.Id == nameGuid
                select a;
    

    or using the extension method directly:

    var query = mainQuery.Where(a => a.TableId.Id == null || 
                                     a.TableId.Id == nameGuid);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to import some data from excel into a database . i got
I am trying to import data from excel file (.xlsx) into sql database, my
Im trying push some data into a CRM system via an XML import. I
I am trying to import an excel file into a data table using GemBox
I am trying to import data from a FoxPro database into Sql Server however
I am trying to import data from excel into a datatable using c#. Here
I'm trying to import about 10K rows of UTF-8 encoded data into a new
I'm trying to pull data into flash using JSON but i keep getting this
I am trying to import a csv file to insert data into an existing
I'm trying to import a cython module data.pyx into another cython module user.pyx. Everything

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.