Hi,
SQL Server 2005 / VS 2005 / LLBLGen Pro v2.0.0.0 Demo Final / Default Template
In the database we have User table to Person table which is a 1:1. There is a Feedback table that contains a FK LoggedByUserID (from the User table) and FK RegardingPersonID (from the Person table).
We make User a Sub-Type of Person before we generate.
There is a datasourcecontrol on a webform, which a r.a.dgrid is bound too:
<llblgenpro:llblgenprodatasource id="personCollectionDataSource" runat="server" datacontainertype="EntityCollection"
entitycollectiontypename="preLink.Data.CollectionClasses.PersonCollection, preLink.Data" enablepaging="True">
</llblgenpro:llblgenprodatasource>
When i run the page i get the following error exception:
"SerializationException: Cannot add the same member twice to a SerializationInfo object."
Source Error:
Line 402: info.AddValue("_alwaysFetchPerson", alwaysFetchPerson);
Line 403: info.AddValue("_alreadyFetchedPerson", alreadyFetchedPerson);
Line 404: info.AddValue("_feedback", _feedback);
Line 405: info.AddValue("_alwaysFetchFeedback", _alwaysFetchFeedback);
Line 406: info.AddValue("_alreadyFetchedFeedback", _alreadyFetchedFeedback);
Source File: C:\Development\Prelink\prelink\src\preLink.Data\EntityBaseClasses\PersonEntityBase.cs Line: 404
Stack Trace:
[SerializationException: Cannot add the same member twice to a SerializationInfo object.]
System.Runtime.Serialization.SerializationInfo.AddValue(String name, Object value, Type type) +2704130
System.Runtime.Serialization.SerializationInfo.AddValue(String name, Object value) +57
preLink.Data.EntityClasses.PersonEntityBase.GetObjectData(SerializationInfo info, StreamingContext context) in C:\Development\Prelink\prelink\src\preLink.Data\EntityBaseClasses\PersonEntityBase.cs:404
preLink.Data.EntityClasses.UserEntityBase.GetObjectData(SerializationInfo info, StreamingContext context) in C:\Development\Prelink\prelink\src\preLink.Data\EntityBaseClasses\UserEntityBase.cs:252
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +281
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +50
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +411
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +489
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) +12
System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +2849
[ArgumentException: Error serializing value 'preLink.Data.CollectionClasses.PersonCollection' of type 'preLink.Data.CollectionClasses.PersonCollection.']
System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3056
System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +126
System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +52
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
System.Web.UI.HiddenFieldPageStatePersister.Save() +106
System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +82
System.Web.UI.Page.SaveAllState() +552
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1676
Is something not being generated correctly?
Thanks