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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:02:42+00:00 2026-06-15T08:02:42+00:00

I am a Linq to SQL newbie and I noticed, when I query the

  • 0

I am a Linq to SQL newbie and I noticed, when I query the database for a result set and store it directly as a List ( using ToList() directly), when I make changes to the list items, those changes persist into the database after I do the SubmitChanges().

Somehow, I always thought ToList() gets me a copy, not the actual set itself. Can someone please expand on this, specifically, I couldn’t find any links on ‘updating the database using Linq to SQL’ vs ‘getting a true copy of result set from the database’.

In other words, if I want a result set which can be editable but not have an affect on the database, what’s the approach?

How do I get a true ‘independent’ copy of a rowset?

  • 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-06-15T08:02:43+00:00Added an answer on June 15, 2026 at 8:02 am

    ToList() apparently is no good, within the scope of the datacontext. Changes to the list items will still be tracked and persisted on submitchanges(). The only way to get a true copy looks like is to do a manual loop-over-and-copy properties

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

Sidebar

Related Questions

Using Linq to SQL How does one query and match to include all rows
Using LINQ to SQL db.Products.Where(c => c.ID == 1).Skip(1).Take(1).ToList(); executes SELECT [t1].[ID], [t1].[CategoryID], [t1].[Name],
How to select all columns from tables in join using linq Sql: select CTRL_RUN_JOB.*,
I have a particular scenario where I wrote my code using LINQ-SQL but I
using Linq-to-SQL I'd like to prefetch some data. 1) the common solution is to
The LINQ-to-SQL query in Visual Studio generates an SQL query with errors. In LINQPad,
LINQ-to-SQL has been a PITA for me. We're using it to communicate to the
Just getting started with Linq to SQL so forgive the newbie question. I'm trying
Definitely a LINQ newbie, but very experienced with SQL and C# and wondering if
Newbie to LINQ, and trying to write the following query... select f.Section_ID, f.Page_ID, f.SortOrder,

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.