生成dataset的XML文件需要一定的格式,要包含dataset的架构信息,包括字段定义等等,你用一个dataset的XML比较一下看看。
解决方案 »
- 请求帮忙~
- [Help].sh和.bat脚本如何合并到一个.bat文件( 共四行代码)
- <authorization>的问题
- C# 如何获取多个视频的总长度
- winform程序 在用代理服务器的局域网中发邮件 问题
- 请教TabControl的问题!
- ★★★一个winform程序,运行后,知道了其句柄,如何根据其句柄给实例的成员变量设值???★★★
- 多线程数据处理的问题?
- 求.net(c#)版软件源码(大概在2005年1月份到5月份在CSDN发的)
- 程序升级的时候 修改存储过程、视图以及表
- 100分请教,能够实现将powerpoint嵌入到我的程序中播放吗?怎么实现?
- 求救 字符转义 selectdeptment("<%#String.Format("{0}", DataBinder.Eval(Container.DataItem, "FName"))%>")
InnerXml是string啊,你怎么赋值给了DataSet
把你需要的XML转换成一个类,然后用它给dataset赋值
if (node != null)
{
node.Attributes["value"].Value ="cc";
}DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(doc));but why cannot you just doDataSet ds = new DataSet();ds.ReadXml(Request.PhysicalApplicationPath + "ReportFiles/" + filePath);directly??
The following example adds a new attribute to the XML document.using System;
using System.IO;
using System.Xml;public class Sample { public static void Main() { XmlDocument doc = new XmlDocument();
doc.LoadXml("<book xmlns:bk='urn:samples' bk:ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>"); XmlNode root = doc.FirstChild; //Create a new attribute.
string ns = root.GetNamespaceOfPrefix("bk");
XmlNode attr = doc.CreateNode(XmlNodeType.Attribute, "genre", ns);
attr.Value = "novel"; //Add the attribute to the document.
root.Attributes.SetNamedItem(attr); Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out); }
}