c# 用dataset读取xml也很方便
来源:互联网 发布:软件生命周期模型 编辑:程序博客网 时间:2024/04/29 14:48
<?xml version="1.0" encoding="utf-8"?> <root> <code>0</code> <message>Success</message> <roles> <role><name>Role1</name><selected>false</selected></role> <role><name>Role2</name><selected>true</selected></role> </roles> </root> DataSet dt = new DataSet(); dt.ReadXml("tt.xml"); string code=dt.Tables["root"].Rows[0]["code"].ToString(); string message = dt.Tables["root"].Rows[0]["message"].ToString(); string name1 = dt.Tables["role"].Rows[0]["name"].ToString(); string selected1 = dt.Tables["role"].Rows[0]["selected"].ToString(); string name2 = dt.Tables["role"].Rows[1]["name"].ToString(); string selected2 = dt.Tables["role"].Rows[1]["selected"].ToString();
<?xml version="1.0" encoding="utf-8"?> <encryption> <info InfoId="1" Password="11" /> <info InfoId="2" Password="22" /> <info InfoId="3" Password="33" /> <info InfoId="4" Password="44" /> <info InfoId="5" Password="55" /> <info InfoId="6" Password="66" /> </encryption> DataSet dt = new DataSet(); dt.ReadXml("t.xml"); for (int i = 0; i < dt.Tables["info"].Rows.Count; i++) { string infoid1 = dt.Tables["info"].Rows[i]["InfoId"].ToString(); string password1 = dt.Tables["info"].Rows[i]["Password"].ToString(); }
0 0
- c# 用dataset读取xml也很方便
- C#读取xml文档数据到DataSet
- C# 用DataSet读取数据
- C# 用DataSet读取数据
- dataset读取xml
- DataSet 读取xml文件
- DataSet读取XML字串
- DataSet 读取XML
- DataSet 读取 Xml 文件
- 用C#读取Excel返回DataSet
- 读取xml数据到DataSet
- 读取XML数据到DataSet
- DataSet 读取xml 导入数据
- c# xml操作类-读取本地和远程xml文件,并返回dataset
- C# 读取Excel到DataSet
- C#读取DataSet中的数据
- C#一行一行读取DataSet 数据
- c#读取excel填入dataset
- 转贴一个很全的sql用法
- 什么是json
- 对称、非对称加密算法、消息摘要算法、数字证书详解
- 在web.xml中配置error页面
- 哈04-xcode系统自带的刷新控件UIRefreshControl
- c# 用dataset读取xml也很方便
- STL map与Boost unordered_map
- 美媒解读云技术五大误区
- cocos2dx之CCDirector
- C/C++程序员必须熟练应用的开源项目
- opengl编程指南笔记(一)前言
- windows XP中,mysql连接时提示:1045 access denied for user 'root'@'localhost' using password yes 的解决方法
- Js实现Map对象
- centos 6 图形界面的关闭与开启