易截截图软件、单文件、免安装、纯绿色、仅160KB

c# 从XML读数据

C#
 DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this.DropDownList1.DataValueField = "value";
this.DropDownList1.DataBind();
XML
<?xml version="1.0" encoding="utf-8" ?>
<selects>
<select>
<text>国家级</text>
<value>1</value>
</select>
<select>
<text>省级</text>
<value>2</value>
</select>
<select>
<text>市级</text>
<value>3</value>
</select>
</selects>


相关文档:

用ASP.NET/C#连接Access和SQL Server数据库

连接Access
首先看一个例子代码片断:
程序代码:
--------------------------------------------------------------------------------
using System.Data;
using System.Data.OleDb;
......
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:\BegASPNET\Northwind.mdb" ......

java 对xml的增删改查

<?xml version="1.0" encoding="UTF-8"?>
<root>
 <person id="1">
  <username >xiaoma</username>
  <password>xiaoma</password>
 </person>
 <person id="2">
  <username>manager</username> ......

DOM4J对XML文档的读写增删改等

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import org.dom4j.Documen ......

xml转换为dataset

        /// <summary>
        /// 读取数据集并加入缓存
        /// sea 2009-12-11
        /// </summary>
      &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号