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

把datatable里的数据转换成xml格式的字符串

string GetXmlByDataTable()
    {
        string xmlstr;
        string sql = "select top 10 * from BasicInfo";
        DataTable dt = idb.ReturnDataTable(sql);
        dt.TableName = "tbname";
        if (dt.Rows.Count>0)
        {
            System.IO.StringWriter writer = new System.IO.StringWriter();
            dt.WriteXml(writer);
            xmlstr = writer.ToString();
        }
        return xmlstr;
    }


相关文档:

XML 属性vs元素

请看下面的示例:
<person sex="female">
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person>
<person>
<sex>female</sex>
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person> ......

Jdom 读取 xml文件例子


Jdom
读取
xml
文件例子
1.         

JDOM
读取
XML
文件需先用
org.jdom.input.SAXBuilder
对象的
build()
方法创建
Document
对象
,
然后用
Document
类、
Element
类等的方法读取
1.
Sample1.java
import
java.util.*;
import
org.j ......

wxwidgets用xml来描述界面,在程序里获取 变量和事件

如果对界面美观程序比较高,手写代码是不可避免的。
但如果做的是一些像只是为了显示、控制之类的程序,可能更快的把程序捣鼓出来就好了。
wxwidgets有这样的一个功能,就是能用xml写成界面就能显示
编辑xrc的工具是wxformbuilder,开源免费的,也足够用了,我一开始没找到怎么生成xrc,后来某次偶然看到了下面....原来有c ......

DataSet、Excel、XML之间的导入导出

class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFi ......

Integration with the XML Data Type

Integration with the XML Data Type
With the introduction of the XML data type, we wanted to also give FOR XML the ability to generate an instance of XML directly (more precisely, it generates a single row, single column rowset where the cell contains the XML data type instance).
Because of the bac ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号