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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:46:35+00:00 2026-06-09T08:46:35+00:00

var locations = (from location in session.Query<Location>() where (location.MB_ID == 0 || location.MB_ID ==

  • 0
var locations = (from location in session.Query<Location>()                                     
             where 
                (location.MB_ID == 0 || location.MB_ID == null) &&
                (location.hide != "Y" || location.hide == null) &&
                (location.locationNameRaw != "" && location.locationNameRaw != null) &&
                ((location.isIPCapableText != "" && location.isIPCapableText != null) || (
                    (location.ISDNNumber1 != null && location.ISDNNumber1 != "") ||
                    (location.ISDNNumber2 != null && location.ISDNNumber2 != "") ||
                    (location.ISDNNumber3 != null && location.ISDNNumber3 != "") ||
                    (location.ISDNNumber4 != null && location.ISDNNumber4 != "") ||
                    (location.ISDNNumber5 != null && location.ISDNNumber5 != "") ||
                    (location.ISDNNumber6 != null && location.ISDNNumber6 != "")                                        
                ))
                && (location.privateRoom == "N" || location.privateRoom == "" || location.privateRoom != null)
                && (
                        from lll in session.Query<LocationLonLat>()                                             
                        where
                            location.locationID == lll.locationId
                        select lll.locationId
                    ).Any()
                && (location.LastUpdatedTime > lastUpdateTime)
                && location.LocationTimes.Count() > 0
               /*&& (
                        from lt in session.Query<LocationTimes>()
                        where
                            location.locationID == lt.LID
                        select lt.LID
                    ).Any()*/
                select location
                  )
                  .ToList();

There is a relationship between Location (1) and LocationTimes (many), and I only want to return a dataset of locations that have at least one LocationTime record.

I tried a couple of things…

When I add the line:

&& location.LocationTimes.Count() > 0

or if I add the line:

  && (                      
     from lt in session.Query<LocationTimes>()
     where
    location.locationID == lt.LID
        select lt.LID
     ).Any()

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

I suspect that this may because of the size of the dataset or something…

Is there a better way of doing this? Like with a ‘left outer join’ or something?

  • 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-09T08:46:37+00:00Added an answer on June 9, 2026 at 8:46 am

    I think a simple join should do it.

    from locationTime in Query<LocationTime>()
    join location in Query<Location>() on locationTime.Location.LocationId equals location.LocationId
    join locationLat in Query<LocationLat>() on location.LocationLat.LocationLatId equals locationLat.LocationLatId
    where ...
    select location;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var search= document.getElementById('appMenu').value document.location.href= '${createLink(controller: 'application' , action:'ajaxAppSearch', params: ['query': search])}' The element appMenu
var tagMatch; if (tagMatch = window.location.href.match(/\/questions\/ask\?tags=([^&]+)/)) { $(function() { if (!$('#tagnames').val().length) { $('#tagnames').val(unescape(match[1].replace(/\+/g, '
I have an array: var locations = ['Afghanistan','Albania','Algeria','New York']; and a string: var string
I have the following for loop: for (loc in locations){ var newLoc = locations[loc].split(,
var ce_info=[ {location:inchannel,name:Jae Jung,volume:50,url:img/jae.jpeg,group:1}, {location:inchannel,name:Houston,volume:50,url:img/houston.jpeg,group:1}, {location:inchannel,name:Jun kuriha..,volume:50,url:img/jun.jpeg,group:1}, {location:inchannel,name:Andrea Melle,volume:50,url:img/andrea.jpeg,group:0}, {location:inchannel,name:Tomoaki Ohi..,volume:50,url:img/ohira.jpeg,group:0}, {location:inchannel,name:Woosuk Cha..,volume:50,url:img/woosuk.jpeg,group:0}, {location:inchannel,name:Luca
The following JQuery get call: var doc_root = document.location.hostname + :8082; var fw_script =
I have the following code: var tlp = new TableLayoutPanel { Location = new
This is very fast in all browsers: var curLayer = new OpenLayers.Layer.Text(layer, { location:
I'm using the following code.. $(document).ready(function(){ $(#test a).click(function(){ var labelTo = $(this).text(); window.location =
I'm trying to project parts of a Display and its list of locations from

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.