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

把xml 转dataset

///通过传入的特定XML字符串,通过 ReadXml函数读取到DataSet中。
protected static DataSet GetDataSetByXml(string xmlData)
{
           try
           {
               DataSet ds = new DataSet();
               using (StringReader xmlSR = new StringReader(xmlData))
               {
                   ds.ReadXml(xmlSR, XmlReadMode.InferTypedSchema); //忽视任何内联架构,从数据推断出强类型架构并加载数据。如果无法推断,则解释成字符串数据
                   if (ds.Tables.Count > 0)
                   {
                       return ds;
                   }
               }
               return null;
           }
           catch (Exception)
           {
               return null;
           }
}
/// 通过传入的xml文件路径(含文件名),将格式化的Xml文件自动读取转换为DataSet。
public s


相关文档:

ArrayList从xml读取数据

ArrayAdapter adapter =
ArrayAdapter.createfromResource(
this,
R.array.catalog,
android.R.layout.simple_list_item_1);

this.setListAdapter(adapter); 
xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name= ......

C#读写xml文件

已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="fantasy" ISBN="2-3631-4">
    <title>Oberon's Legacy</title>
    <author>Corets, Eva</author>
  &nb ......

更快的写XML的方法

我写的第一个程序中写XML的代码执行速度有些问题,改了一下,现在有所改善。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Data.SqlClient;
......

JAVA对XML的几种解析方法讲解(JDOM)

为减少DOM、SAX的编码量,出现了JDOM;
优点:极大减少了代码量。
使用场合:要实现的功能简单,如解析、创建等,但在底层,JDOM还是使用SAX(最常用)、DOM、Xanan文档。
必须得下载jdom.jar文件
package xml.jdom;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOExce ......

自动检索XML数据

1.books.html
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号