Newtonsoft JSON- Conversion to/from DataSet causes Decimal to become Double?
问题 I'm using Newtonsoft JSON to serialize a DataSet to binary JSON using the code below. When de-serializing back to a DataSet, the field type changes from a Decimal to a Double? Does anybody know what's going wrong? Sample code: static void Main(string[] args) { var ds = new DataSet(); var dt = ds.Tables.Add(); dt.Columns.Add("Test", typeof(Decimal)); dt.Rows.Add(new object[] { 1.23345M }); var data = DataSetToBinJSON(ds); var ds2 = BinJSONToDataSet(data); Console.WriteLine((ds2.Tables[0]