Re: WriteXML



Not sure what I'm doing wrong here. Here is a snippet of my export and at
the and is the result. I've verified the data in the datatables.
public void ExportXmlRecord(string sFilePath)

{

DataSet dsTemp = new DataSet();

Ds.spGetCardioScheduleDataTable CS = new Ds.spGetCardioScheduleDataTable();

DataTable _dtEchoExport = new Ds.spGetEchosDataTable();

Ds.spGetCardioScheduleRow csRow = (Ds.spGetCardioScheduleRow) CS.NewRow();

Ds.spGetEchosRow ecRow = (Ds.spGetEchosRow) _dtEchoExport.NewRow();

csRow.ItemArray = _DrCS.ItemArray;

ecRow.ItemArray = _dtEchosRes.Rows[0].ItemArray;

CS.AcceptChanges();

_dtEchoExport.AcceptChanges();

dsTemp.AcceptChanges();

_dtEchoExport.NewRow();

dsTemp.Tables.Add(CS);

dsTemp.Tables.Add(_dtEchoExport);

dsTemp.WriteXml(sFilePath,XmlWriteMode.IgnoreSchema);

return;


}

Here's the result:

<?xml version="1.0" standalone="yes"?>
<NewDataSet />

Any help is appreciated.


"Kevin Yu [MSFT]" <v-kevy@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:pwTwd$rBGHA.3764@xxxxxxxxxxxxxxxxxxxxxxxx
> Hi David,
>
> As you can see, the DataSet.WriteXml method can only write the whole
> DataSet data to an Xml stream. In this case, if you only need to pick some
> of the rows, creating a new dataset and copy the row you need to write
> will
> be a good idea.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>


.



Relevant Pages

  • Re: Faster way to read an Excel sheet
    ... This depends on if the driver supports returning multiple resultsets. ... that two DataTables will be created in a DataSet. ... Kevin Yu ... "This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.dotnet.framework.adonet)
  • LINQ syntax question
    ... Someone asked me how I would do the following....suppose you have two ADO.NET datatables, and you want to do the equivalent of SELECT Table1.*, Table2.*. ... "Notes 1 for Kevin S. Goff"); ... join rowNoteData in dtNotes.AsEnumerable ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: is dataset empty
    ... A DataSet can have 0-N DataTables. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... "Rock" wrote in message ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Move Data from table to Array
    ... DataTables like the following: ... In this case, if the schema of the tables are the same, when filling the ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)