用户提交时生成XML字符串,并保存到数据库的字段中,然后,根据XML字符串的不同,DataSet中将包含多个DataTable,选取不同的DataTable绑定到相应的Web控件上。
private
DataSet GetDataSet()
{
try
{
string text = GetXMLText();
XmlTextReader reader = new XmlTextReader( new StringReader(text));
reader.WhitespaceHandling = WhitespaceHandling.None;
DataSet ds = new DataSet();
ds.ReadXml(reader);
reader.Close();
ds.Dispose();
return ds;
}
catch (Exception err)
{
throw new Exception( " GetDataSet方法异常: " + err.Message);
}
}
{
try
{
string text = GetXMLText();
XmlTextReader reader = new XmlTextReader( new StringReader(text));
reader.WhitespaceHandling = WhitespaceHandling.None;
DataSet ds = new DataSet();
ds.ReadXml(reader);
reader.Close();
ds.Dispose();
return ds;
}
catch (Exception err)
{
throw new Exception( " GetDataSet方法异常: " + err.Message);
}
}