Esempio n. 1
0
        private static void ExportDataSet(ExportContext context, DataSet dataSet, JsonWriter writer)
        {
            Debug.Assert(context != null);
            Debug.Assert(dataSet != null);
            Debug.Assert(writer != null);

            writer.WriteStartObject();

            foreach (DataTable table in dataSet.Tables)
            {
                writer.WriteMember(table.TableName);

                //
                // If there is an exporter (perhaps an override) for the
                // DataTable in effect then use it. Otherwise our
                // DataTableExporter.
                //

                IExporter tableExporter = context.FindExporter(table.GetType());

                if (tableExporter != null)
                {
                    tableExporter.Export(context, table, writer);
                }
                else
                {
                    DataTableExporter.ExportTable(context, table, writer);
                }
            }

            writer.WriteEndObject();
        }
Esempio n. 2
0
 private static void ExportDataSet(ExportContext context, DataSet dataSet, JsonWriter writer)
 {
     Debug.Assert(context != null);
     Debug.Assert(dataSet != null);
     Debug.Assert(writer != null);
     writer.WriteStartObject();
     foreach (DataTable table in dataSet.Tables)
     {
         writer.WriteMember(table.TableName);
         DataTableExporter.ExportTable(context, table, writer);
     }
     writer.WriteEndObject();
 }