C#²éѯÊý¾Ý¿â°Ñ½á¹ûÊä³öµ½XMLµÄÀý×Ó
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//string sqlconn = "server=(local);database=keede1228;user id=sa;password=123;";
//windowsÉí·ÝÑéÖ¤
string sqlconn = "server=(local);database=keede1228;integrated security=SSPI;";
string select = "dirr4";
SqlConnection conn = new SqlConnection(sqlconn);
Console.WriteLine("33");
conn.Open();
Console.WriteLine("11");
//SqlCommand cmd = new SqlCommand(select, conn);
//SqlDataReader reader = cmd.ExecuteReader();
//while (reader.Read())
//{
// Console.WriteLine("cityid:{0} city:{1} area:{2}", reader[0], reader[1], reader[2]);
//}
SqlDataAdapter da = new SqlDataAdapter(select, conn);
DataSet ds = new DataSet();
da.Fill(ds, "custo");
foreach (DataRow row in ds.Tables["custo"].Rows)
Console.WriteLine("'{0}'from {1}", row[0], row[1]);
ds.WriteXml("write.xml", XmlWriteMode.WriteSchema);
conn.Close();
Console.WriteLine("22");
Console.ReadKey();
}
}
}
DataSetÀàÌ«Ç¿´óÁË£¡
Ïà¹ØÎĵµ£º
´ËXMLʵÀýÒÔ·þÎñÆ÷¶Ë²¿ÃŹÜÀíΪÀý£º£¨Æä½çÃæÈçÏ£©
private void btn_UpdateGroup_Click(object sender, EventArgs e)
{
XmlDocument xmlDoc = new XmlDocument();
& ......
1.Èç¹ûÐèÒªÔÚÓ¦ÓóÌÐòÖд¦ÀíxmlÊý¾Ý£¬Ê×ÏÈÒª´´½¨1¸öXmlDocument¶ÔÏó£¬È»ºóͨ¹ýload·½·¨´ÓxmlÊý¾ÝÔ´ÖмÓÔضÔÏó¡£
2.xmlÖеÄÊý¾ÝÖ÷Òª±íÏÖΪԪËغÍÊôÐÔÁ½ÖÖÐÎʽ¡£
3.¶ÁÈ¡ÔªËØ
¶ÁÈ¡ÔªËØ¿Éͨ¹ýij½ÚµãµÄChildNodesÊôÐÔ»ñÈ¡Æä×ӽڵ㼯ºÏ£¬È»ºó¸ù¾Ý½ÚµãµÄNodeTypeÊôÐÔÈ·¶¨´Ë½ÚµãÊÇ·ñÊôÓÚÔªËؽڵ㡣ԪËؽڵãµÄÃû³Æ¿Éͨ¹ýNameÊôÐÔ» ......
×÷Õߣºwuhua
¿Õ¼ä£ºhtt://wuhua.3geye.net
תÔØÇë±£ÁôÉÏÃæµÄÐÅÏ¢£¨Çë×ðÖØ֪ʶ²úÆ·£©Ð»Ð»
ÏàÐÅ´ó¼Ò¶¼ÓùýKxmlµÄ¶«Î÷ÁË£¬²»¹ý¸öÈ˸оõkxml»¹ÊÇ´óÁËЩ¡£ÏÖÔÚ½éÉÜÒ»¸ö±Èkxml¸ú¼ò½éµÄxmlµÄÀà¡£¶ÔÓÚһЩСÏîÄ¿£¬»òÕ߶Ôxml½âÊÍÒªÇó²»ÊǺܸߵÄÏîÄ¿À´ËµÈ´ÊǸö²»´íµÄÑ¡Ôñ¡£
ÏÂÃæ¿´¿´ÄÇ´úÂëÓëDemo°É¡£
Java´úÂë
package o ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//string sqlconn = "ser ......