public void SerializeDataSet2()
{
DataSet quota = new DataSet("Quota");
// Dimension
DataTable dt = new DataTable("Dimension");
quota.Tables.Add(dt);
dt.Columns.Add("Number", typeof(int));
dt.Columns["Number"].AllowDBNull = false;
dt.Columns["Number"].ColumnMapping = MappingType.Attribute;
dt.Columns.Add("Title", typeof(string));
dt.Columns["Title"].AllowDBNull = false;
dt.Columns["Title"].ColumnMapping =
MappingType.Attribute;
dt.Rows.Add(new object[] { 0, "Hospitals" });
dt.Rows.Add(new object[] { 1, "Doctors" });
dt.Constraints.Add("PK_Dimension", dt.Columns["Number"], true);
quota.AcceptChanges();
XmlSerializer ser = new XmlSerializer(quota.GetType());
StringWriter sw = new StringWriter();
ser.Serialize(sw, quota);
DataSet ds = (DataSet)ser.Deserialize(new StringReader(sw.ToString()));
}