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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:43:01+00:00 2026-05-20T22:43:01+00:00

My problem is related to when I want to Delete a Item off a

  • 0

My problem is related to when I want to Delete a Item off a Order,

I just dont get why it is returning a null value it should just delete the item.

protected void gvRevOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
    Int64 ID = new Int64();
    ID = (Int64)e.Keys["ProductID"];

    using (DatabaseCourseWorkEntities  context = new DatabaseCourseWorkEntities())
    {
        CWInvoiceItem item = (from p in context.CWInvoiceItems 
                              where p.ProductID == ID 
                              select p).SingleOrDefault();

        context.CWInvoiceItems.DeleteObject(item);
        context.SaveChanges();
    }

below i have put a link of the thing i am trying to delete and as you can see the ProductID = 38 and the Variable ID also has 38 any ideas?

enter image description here

I’ve tried all sorts such as FirsOrDefault and such.

  • 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-20T22:43:02+00:00Added an answer on May 20, 2026 at 10:43 pm
    1. Check that context.CWInvoiceItems contains ANY data
    2. Check that the context points to the correct data source
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a list of related products in my eshop. The problem
I just had a NHibernate related problem where I forgot to map one property
I'm having a problem in my c++ game related with the vector. I want
Interesting problem related to firing commands from context menu items... I want to fire
This isn’t trully a problem, I just want to understand. Considering the following code:
Edit : Problem wasn't related Event Propagation, if you want to know how to
I am checking problem related to rendering and fonts. Comments in GraphicsEnvironment.html#getAllFonts() mentions '
I have a problem related to an array data which fetched from an external
hello I am having problem related to https:// . I have used FB.getLoginStatus(function(response) function
I have a performance problem related to string comparison (in Java). I'm working on

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.