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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:50:46+00:00 2026-05-26T11:50:46+00:00

Im want to delete rows from a table that in my data base. i

  • 0

Im want to delete rows from a table that in my data base.
i have the member

private static WeightScaleEntities Weight = new Weight();

this member contains my database. in the data base i have table: User_Activity.

I want to delete rows from user activity by given i_UserActivityId, as follow:

//Get the rows for delete
var deleteUserActivities = from details in Weight.User_Activity
                                   where details.Id == i_UserActivityId
                                   select details;

Now i want to delete this rows, so i tried to do:

foreach (var item in deleteUserActivities)
{
         m_WeightScaleEntities.User_Activity.*
}

and i dont get the method DeleteOnSubmit!

Why?
there is another option???

  • 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-26T11:50:47+00:00Added an answer on May 26, 2026 at 11:50 am

    User_Activity.*: is that a typo?

    What I think you want is:

    foreach (var item in deleteUserActivities)
    {
         Weight.DeleteObject(item);
    }
    

    And then SaveChanges() on the object context.

    BTW, a static object context is not a good idea. You should carefully control the life cycle of object contexts.

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

Sidebar

Related Questions

i have list of rows that user select and i want to delete them,
I want to remove all rows that i entered from my SQLite database table.
I erroneously delete all the rows from a MS SQL 2000 table that is
I have a table with data that I don't need to keep for very
I have two tables users registered_members I want to confirm values from user table
I have a DataGridView that displays data from a MS Access database. I'm using
I have a gridview that binds its rows from an objects method: public DataSet
I have a huge table in a database and I want to split that
I'm writing an application in PHP 5. I want to delete some rows in
I want to see how many rows my delete query effects so I know

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.