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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:56:37+00:00 2026-05-30T22:56:37+00:00

Okay, I am trying to write a LINQ query with a Join in it,

  • 0

Okay, I am trying to write a LINQ query with a Join in it, using VB on .NET 4.0.

I get the red squiggle under my line of code and when I mouse over it, it shows:

“Cannot not transform LINQ”

Note the double-negative.

Anyone have a clue what this error means? Grammatically it would mean there is NO error, but I don’t know why there should even be an error message then. This “error” also kills auto-complete on the line in question, as if there actually IS an error. So I’m confused.

Here are my variable declarations:

Dim dateTimes As Date() = GetDates()
Dim readings = (
    From dr As DataRow In dbReadings.Rows 
    Where dr("SENSORID") = sensorid 
    Select New Device.Reading With {
        .Dated = CDate(dr("DATEDT")), 
        .Value = CSng(dr("VALUE")), 
        .Exception = CBool(dr("EXCEPTION"))
    })

Here is my query which I’m being told cannot be queried:

Dim joined = From dt As Date In dateTimes 
             Join r As Device.Reading In readings On r.Dated = dt 
             Into DateTimeReadings From r In DateTimeReadings.DefaultIfEmpty() 
             Select r.Value

I’m trying to get a list of readings for all the date-times in dateTimes, including blank entries for dates for which there is no reading.

  • 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-30T22:56:38+00:00Added an answer on May 30, 2026 at 10:56 pm

    Try using Cast(Of T)() since you can’t use linq against data row collection

        Dim joined = From dt As Date In dateTimes 
    Join dr As DataRow In sreadings.rows.Cast(Of DataRow)() 
                 On CDate(dr("DATEDT")) = dt
    

    http://msdn.microsoft.com/en-us/library/bb341406.aspx#Y0

    Try this (sorry, it’s in C#)

    var res1 = dates.Join(sreadings.rows.Cast<DataRow>()
                    , c => c, d => d.Field<DateTime>("DATEDT"), (date, row) => new { Date = date, Row = row });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I'm trying to write a Linq query to run on a list of
I am trying to write a code generator do to Mapping between any two
Okay, I'm trying to write a ruby simulation of my grandmother. I can't quite
I'm trying to profile a C++ application, that I did not write, to get
Im trying to write optimized code for accesing image pixels and need to make
I'm trying to write some metaprogramming code such that: Inheriting from some class foo<c1,
I am trying to write a Microsoft SQL Server query for retrieving the oldest
Okay, so I'm trying to write a simple show/hide content button, but I want
Okay I'm trying to go for a more pythonic method of doing things. How
Okay so I'm trying to make a little gag program that will run away

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.