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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:11:34+00:00 2026-05-16T01:11:34+00:00

This is giving me a headache. I have this link query here that grabs

  • 0

This is giving me a headache. I have this link query here that grabs an ID

Dim mclassID = From x In db.SchoolClasses Where x.VisitDateID = _visitdateID Select x.ClassID

And then later on I have this linq query

ViewData("Staff") = From t In db.Staffs Where t.ClassID = mclassID Select t

Any help would be much appreciated. I’ve tried quite a few things but to no avail. I’ve attempted casting, converting, Is operand, etc.

  • 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-16T01:11:34+00:00Added an answer on May 16, 2026 at 1:11 am

    The problem is that myClassID is an anonymous IQueryable. You need to force it into another type (List is my favorite), and then pull it out of that type. So if you were to select it into a List(Of Integer) you could then extract the First() one since it would be the only. You could try something like this:

    Dim myClassIDList As List(Of Integer) = New List(Of Integer)( _
        From x In db.SchoolClasses Where x.VisitDateID = _visitdateID Select x.ClassID)
    
    Dim myClassID as Integer = myClassIDList.First()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem is giving me a real headache. I have two tables in my
This is giving me such a headache i just have to ask. I never
This has been giving me a headache for about two days now! I have
I Have a similar issue like the one listed here pointer-to-a-pointer-to-a-struct-giving-headache my issue is
OK, here's yet another sql query that's giving me headaches. Case: I'm listing a
I have this problem I'm working on which is giving me a headache, because
This seems rather simple but it has been giving me a headache. I have
I have a very simple problem that is giving me a really big headache
this is just weird and is giving me a headache. I looked over my
Okay, so for some reason this is giving me a error as seen here:

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.