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

  • Home
  • SEARCH
  • 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 7029127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:29:51+00:00 2026-05-28T00:29:51+00:00

I have a LINQ -> Class file named MoviesDB.dbml, I have added one table

  • 0

I have a LINQ -> Class file named MoviesDB.dbml, I have added one table “Movie” to it, i have created a class “Movies” in which i have implemented inside all the methods.

Method GetAllMovies which gets a List, when binding the list i get the following:

Type 'DyMvWebsite.Movie' in Assembly 'DyMvWebsite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. 

The code for the Method:

        public static List<Movie> GetAllMovies()
    {
        List<Movie> oMoviesList = new List<Movie>();

        using (MoviesDBDataContext oMoviesDBDataContext = new MoviesDBDataContext())
        {
            oMoviesList = oMoviesList.ToList<Movie>(); ;
        }

        return oMoviesList;
    }

After that i have tried putting the [Serializable] attribute in the “Movies” class and tried putting it in the linq designer file too, but same problem.

Edit:

After following what ‘Massimiliano Peluso’ suggested, i received a new error:

Type 'System.Data.Linq.ChangeTracker+StandardChangeTracker' in Assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. 
  • 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-28T00:29:52+00:00Added an answer on May 28, 2026 at 12:29 am

    Try this out

      MoviesDBDataContext.ObjectTrackingEnabled = false;
    

    before firing the query.

    If this still fails, then the work around will be create serializable class similar to Movie class, and map the properties.

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

Sidebar

Related Questions

I have a LINQ to SQL class VoucherRecord based on a simple table. One
I have a BankAccount table. LINQ to SQL generates a class named BankAccount as
I have a class reflecting my dbml file which extends DataContext, but for some
I have a Linq-To-Sql based repository class which I have been successfully using. I
I have a class which provides generic access to LINQ to SQL entities, for
I have a dbml file (linq to sql) to connect to my database. I
I have created a data table using disconnected class, also created the data set,xml
I have three pages: Login.aspx, Index.aspx and a C# class file named GlobalData.cs The
I have a class containing Linq To SQL objects that are used to populate
I have a bunch of entity class (generated by Linq to SQL) with 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.