After loaded dataset from xml file, if InvalidCastException was thrown with properties, or ArgumentException was thrown while ReadXml(fileName, XmlReadMode.InferSchema):
A way: ReadXml(fileName, XmlReadMode.IgnoreSchema), then update the properties value(this can be done by load xml file to XmlDocument, then replace the dataset properties with the XmlDocument values.)
博客介绍从XML文件加载数据集时可能出现的异常,如属性引发的InvalidCastException,或ReadXml(fileName, XmlReadMode.InferSchema)时的ArgumentException。给出解决办法,即使用ReadXml(fileName, XmlReadMode.IgnoreSchema),再更新属性值,可通过将XML文件加载到XmlDocument实现。

被折叠的 条评论
为什么被折叠?



