I would still create a "strongly typed dataset" object.
They're easier to deal with.
HEre is one I use:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="ExceptionLo gDS"
targetNamespace ="http://tempuri.org/ExceptionLogDS. xsd"
elementFormDefa ult="qualified"
attributeFormDe fault="qualifie d"
xmlns="http://tempuri.org/ExceptionLogDS. xsd"
xmlns:mstns="ht tp://tempuri.org/ExceptionLogDS. xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata">
<xs:element name="Exception LogDS" msdata:IsDataSe t="true">
<xs:complexType >
<xs:choice maxOccurs="unbo unded">
<xs:element name="Exception ">
<xs:complexType >
<xs:sequence>
<xs:element name="Exception Message" type="xs:string " minOccurs="0" />
<xs:element name="Exception Type" type="xs:string " minOccurs="0" />
<xs:element name="Exception DateTime" type="xs:dateTi me" minOccurs="0"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
the the code to add new entries:
mine is kludgey, but shows simple WriteXml methods.
private void SaveErrorDataSe t(ExceptionLogD S ds , Exception ex)
{
if (null!=ds)
{
string uuid = System.Guid.New Guid().ToString ();
string xmlfileName = uuid + ".xml";
string exceptionFileNa me = uuid + ".log";
if (this.m_errorOu tputDirectory.L ength 0 )
{
if (!System.IO.Dir ectory.Exists(t his.m_errorOutp utDirectory))
{
System.IO.Direc tory.CreateDire ctory(this.m_er rorOutputDirect ory);
}
xmlfileName = this.m_errorOut putDirectory + @"\" + xmlfileName;
exceptionFileNa me = this.m_errorOut putDirectory + @"\" +
exceptionFileNa me;
}
ds.WriteXml(xml fileName);
DataSets.Except ionLogDS exDS = new
GranadaCoder.Ap plications.Bulk DataTransferExa mple.DataSets.E xceptionLogDS
();
exDS.Exception. AddExceptionRow (ex.Message , ex.GetType().To String() ,
DateTime.Now );
exDS.WriteXml(e xceptionFileNam e);
}
}
"Sathyaish" <sa*******@gmai l.comwrote in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
Please ignore this question. There was an error in my XML. I was too
much in a hurry to post this question before checking.