Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Linq to SQL

$
0
0

Hi Team,

I am using Visual studio 2012 for my application developement using Linq to SQL.  I have a database design with one-many relation tables Say master and transaction table.  When i try to access the data from master table, I am getting the following error

Type 'xxxxxxxx' in Assembly 'xxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ed198dfa597974ae' is not marked as serializable

My query is as follows:

var objMaster = from obj in _objContext.<tablename>
                                           where obj.IsActive == true
                                           select obj;

Above the definition of table i tried adding [Serializable] but it gives the following error. 

[Serializable]

public tblSysxx tblSysxxx

Error: Attriute 'Serializable is not valid on this declaration type.  It is only valid on class, struct, enum, delegate declaration

This master table is shown as EntityRef in linq to sql file. When i generate a separate linq to sql file with this table alone I am able to get the partial class method and it is working fine.

Since i need this table to be part of relation in existing linq to sql file, I am able to see only the above definition with EntityRef and not able to find partial class definition to add [Serializable] attibute.

Request you to please let me know the work around and revert for any clarifications pls

Regards,

Krishna Murthy G


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>