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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:41:19+00:00 2026-05-31T17:41:19+00:00

I had a code segment on an asp.net page in the code-behind file. I

  • 0

I had a code segment on an asp.net page in the code-behind file. I decided to move it into a public subroutine in a module (general_functions.vb). Once I did this, however, the code no longer works – it throws an error.

On the original code-behind I replaced the original code with a call like so:

DeleteResidency(people_id, semester, year)

Now in my general_functions.vb I created a public subroutine like follows:

Public Sub DeleteResidency(delpeople_id, delsemester, delyear)
    Using dbContext as pbu_housingEntities = New pbu_housingEntities
        Dim remove_selection = (From p in dbContext.Residents _
                               Where p.people_code_id = delpeople_id _
                               Where p.year = delyear _
                               Where p.semester = delsemester _
                               Order By p.id Descending _
                               Select p).FirstOrDefault
    End Using
End Sub

There is more code to it than that, but the code above is what throws the error. The error I get is:

LINQ to Entities does not recognize the method ‘System.Object
CompareObjectEqual(System.Object, System.Object, Boolean)’ method, and
this method cannot be translated into a store expression.

Can anyone help me understand why this is occurring?

  • 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-31T17:41:20+00:00Added an answer on May 31, 2026 at 5:41 pm

    Explicitly type your parameters in the definition of the DeleteResidency Sub Routine. This leaves less for the compiler to infer and prevents these types of errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Had a code smell moment and couldn't decided if its OK for a class
I had this code that help me fetch the URL of an actor page
I previously had code that used File.ReadAllLines() to read a text file and store
Asked an unrelated question where I had code like this: public boolean equals(Object obj)
I originally had a code segment that iterated through rows of an Excel spreadsheet
I had code that worked fine when running in the context of the main
Suppose you had code like this: _READERS = None _WRITERS = None def Init(num_readers,
I had some code that ran commands through Runtime.getRuntime.exec(String) , and it worked on
We recently had a code review . One of my classes was used so
I was looking at an authentication system which had this code: # prevents a

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.