E
ertanasan1
Hi,
//Returns a new dataset with tree datatables.
dsTemp.ReadXmlSchema(@"C:\mysch.xsd");
//Add a row to data table 0
DataRow dr = dsTemp.Tables[0].NewRow();
dr["field1"] = "value1";
dsTemp.Tables[0].Rows.Add(dr);
//write dataset to xml
System.IO.StringWriter stream = new System.IO.StringWriter();
dsTemp.WriteXml(stream);
string xmlTemp = stream.ToString();
When writing to xml, it looses schema information. The output xml is
not competible with mysch.xsd which has been read at first.
What would be the reason?
Thanks.
Ertan
//Returns a new dataset with tree datatables.
dsTemp.ReadXmlSchema(@"C:\mysch.xsd");
//Add a row to data table 0
DataRow dr = dsTemp.Tables[0].NewRow();
dr["field1"] = "value1";
dsTemp.Tables[0].Rows.Add(dr);
//write dataset to xml
System.IO.StringWriter stream = new System.IO.StringWriter();
dsTemp.WriteXml(stream);
string xmlTemp = stream.ToString();
When writing to xml, it looses schema information. The output xml is
not competible with mysch.xsd which has been read at first.
What would be the reason?
Thanks.
Ertan