Thursday 15 April 2010

WCF Linq to SQL Table - System.Data.Linq.Table cannot be serialized -


I can not understand this because I go through the demos that start working. I have a WCF service that I was trying to use to SQL from Linux. However, I never get the error error. System.Data.Linq.Table can not be serialized. So I started with my own class, I can back up until I get this error. The problem is also trying to use an empty square. Just using my method "System.Linq.Table (XXX)" gives me this error.

Type 'System.Data.Linq.Table`1 [LinqADMRequest2b]' can not be sorted, consider marking it with the DataContractAttribute attribute, and marking all its members Do the ones you want to be sorted with the DataMemberAttribute attribute. See the Microsoft .NET Framework Document for other supported types.

  Import System.ServiceModel Import System.ServiceModel.Activation Import System.Runtime.Serialization Import System.Collections Generic Impressions Lynch & Lt; Service contract (namespace: = "")> _ & lt; Service Levière (Exposition Dictive Influences: Include = Trues)> APNnet Compatibility Values ​​(Requirements Mode: = AssetNetTatilityUurraymentsMod. Validate)> _ Public Class Compilitrack WCFS Service_Public Function GetTestRequests () as System.Data.Linq.Table (LinqADMRequest2b) '' Rich queryresults = ct.ADMRequests 'ct.ADMRequestGetListByUser ("", "155")' Retrieve queryresults ending function of the class 'lynx' as new Linq2.ComplyTrackDataContext & lt; DataContract ()> _ & lt; Serializable ()> _ Public class LinqADMRequest2b implements the ISerializable Private _firstName string_public property FirstName () Get the string return as the firstname-set (set byVal value string) _firstName = Go value end set end property public sub GetObjectData (ByVal information as System.Runtime.Serialization.SerializationInfo, ByVal implements System.Runtime.Serialization.StreamingContext) as the system.Runtime.Serialization implements ISerializable.GetObjectData End Sub End Class  

As you can see GetTestRequests () does nothing, then it says that this system is returning. Data.Linq.Table (of LinqADMRequest2b)

I can not order LinqADMRequest2b.

Type 'System.Data.Linq.Table`1 [LinqADMRequest2b]' can not be serialized. Consider marking it with the DataContractAttribute attribute, and mark all its members that you want them to be serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework Documentation for other supported types.

don do not return from your service table & lt; T & gt; This is a complex query type that relies on its datacentext and is not an in-store archive.

Return List ; & Gt; , you can see the table & lt; T & gt; a list & lt; T & gt; By calling System.Linq.Enumerable.ToList ()


No comments:

Post a Comment