dotnetdbf icon indicating copy to clipboard operation
dotnetdbf copied to clipboard

DotNetDBF.MemoValue cannot be serialized because it does not have a parameterless constructor.

Open jbtule opened this issue 12 years ago • 0 comments

Reported by [email protected], Dec 12, 2011 What steps will reproduce the problem?

DataTable table = new DataTable("Artikli"); DataColumn column; DataRow row;

foreach (DBFField i in reader.Fields) { column = new DataColumn(); column.ColumnName = i.Name; column.DataType = i.Type; table.Columns.Add(column); }

table.WriteXml(Path.ChangeExtension(path, "xml"));

What is the expected output? What do you see instead? Exception: "DotNetDBF.MemoValue cannot be serialized because it does not have a parameterless constructor."

What version of the product are you using? On what operating system? 4.0, Windows 7 x64, VS2010

Please provide any additional information below.

Solution: Add null/empty constructor in DotNetDBF.MemoValue.cs public MemoValue() { _lockName = string.Format("DotNetDBF.Memo.new.{0}", Guid.NewGuid()); }

jbtule avatar May 10 '13 12:05 jbtule