public xml()
{}
public enum XmlType
{
File;
String;
}
///读XML资源到DataSet中
//Source : XML资源,文件为路径,否则为字符串
//XmlType: Xml资源类型
public static DataSet GetDataSet(string Source ,XmlType xmlType)
{
DataSet ds = new DataSet();
if(xmlType == XmlType.File)
{
ds.ReadXml(Source );
}
else
{
XmlDocument xd = new XmlDocument ();
xd.LoadXml(Source );
XmlNodeReader xnr = new XmlNodeReader (xd);
ds.ReadXml(xnr);
}
return ds;
}