Sunday, March 14, 2010

How to read and write a DataSet from and to XML (C#)

private DataSet ReadDataSet(string dataPath)
{
    DataSet ds = new DataSet();
    ds.ReadXml(dataPath, XmlReadMode.ReadSchema);
    return ds;
}
private void WriteDataSet(DataSet ds, string path)
{
    ds.WriteXml(path, XmlWriteMode.WriteSchema);
}

No comments:

Post a Comment