Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

What does IQueryable with no records return to C# program

Posted on 2011-09-22
4
Medium Priority
?
245 Views
Last Modified: 2012-06-22
In the attached code, if there are no records, will "x" be null?  If not, what will it be?

Thanks.

var x = from i in dc.table where i.field == "xyz" select i;

Open in new window

0
Comment
Question by:g_johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
g_johnson earned 0 total points
ID: 36581808
Actually what I found out by testing was that it returns an empty collection, i.e., x.Count() = 0.

Thanks for taking a look
0
 
LVL 4

Author Closing Comment

by:g_johnson
ID: 36708107
This turns out to be the correct answer.
0
 
LVL 4

Author Comment

by:g_johnson
ID: 36581818
Testing proves out that x is not null when the statement is executed.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question