Hi,
I have been looking at the demo version 2.5 and using VS2005.
I am trying to follow the Adapter tutorials whilst using my own database tables from SQL 2005. The runtime SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll lib version is 2.5.7.1119
I have a windows console with the following code:
static void Main(string[] args)
{
RelationPredicateBucket filter = new RelationPredicateBucket();
EntityCollection<SpmcustomersEntity> customers = new EntityCollection<SpmcustomersEntity>();
// [C#]
StreamWriter writer = new StreamWriter("customer.XML");
string customerXml = String.Empty;
customers.WriteXml(out customerXml);
writer.Write(customerXml);
writer.Close();
// now read it back
StreamReader reader = new StreamReader("customer.XML");
string xmlFromFile = reader.ReadToEnd();
reader.Close();
SpmcustomersEntity customerFromXml = new SpmcustomersEntity();
customerFromXml.ReadXml(xmlFromFile);
}
The code causes an exception when trying to read back the xml file with the following exception:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="SD.LLBLGen.Pro.ORMSupportClasses.NET20"
StackTrace:
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.Xml2Entity(XmlNode node, Dictionary2 processedObjectIDs, List
1 nodeEntityReferences)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ReadXml(XmlNode node, XmlFormatAspect format)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ReadXml(String xmlData)
at ORMapperConsole.Program.Main(String[] args) in C:\Documents and Settings\Neil\My Documents\LLBLGen Pro Projects\ORMapperConsole\Program.cs:line 123
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Any idea what I have done wrong?
I have attached the XML output.
Thank you in advance,
Neil.
Attachments
Filename |
File size |
Added on |
Approval |
customer.XML
|
753 |
26-Nov-2007 14:59.53 |
Approved |