Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XMLÔö\ɾ¡¢¸Ä¡¢²é¼òµ¥²Ù×÷

  protected void Page_Load(object sender, EventArgs e)
    {
        lblValue.Text = string.Format("{0:N}", 2500000);
        lblValue.Text = string.Format("{0:C3}", 2);
        // ¼ÓÔØÊ±²»»º´æÊý¾Ý
        Response.Cache.SetNoStore();
        if (!IsPostBack)
        {
            // ³õʼ»¯Ò³ÃæÏÔʾ
            ShowXml();
        }
    }
    // ³õʼ»¯Ò³ÃæÏÔʾ
    private void ShowXml()
    {
        // »ñÈ¡xmlÊý¾Ý
        string url = Server.MapPath("user.xml");
        StreamReader sr = new StreamReader(url, System.Text.Encoding.GetEncoding("GB2312"));
        // ²Ù×÷xmlÎĵµ
        XmlDataDocument xmlDataDocument = new XmlDataDocument();
        // ½«¶ÁÈ¡µÄ×Ö½ÚÁ÷±£´æµ½DataSetÖÐ
        xmlDataDocument.DataSet.ReadXml(sr);
        this.DataGrid1.DataSource = xmlDataDocument.DataSet.Tables[0].DefaultView;
        // ¶¨ÒåÏÔʾID
        this.DataGrid1.DataKeyField = "username";
        this.DataGrid1.DataBind();
        xmlDataDocument = null;
        sr.Close();
    }
    protected override void OnInit(EventArgs e)
    {


Ïà¹ØÎĵµ£º

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Éí·ÝÑéÖ¤
//s ......

ÀûÓÃSqlHelper(ExecuteXmlReaderʹÓÃ)£¬×ª»»µ½xml¸ñʽ

ÀûÓÃsqlhelperÖеÄExcuteXmlReader·½·¨£¬¶ÁÈ¡Êý¾Ý²¢±£´æÎªxmlÎļþ     
 string strConn = Properties.Settings.Default.Connections;
           SqlConnection connection = new SqlConnection(strConn);
    & ......

XML ½âÎöc++Ô´Â루ͷÎļþ£©

/*
 * XMLTool.h ÅäÖÃÎļþ½âÎö¶¯Ì¬¿âÍ·Îļþ
 *  Ö÷ÒªÊä³öº¯Êý½Ó¿Ú·Ö±ðʵÏÖ¶ÔÅäÖÃÎļþµÄ¶ÁÈ¡ºÍдÈ룬Õë¶Ô½á¹û¼¯µÄ¸´ÖÆÇå¿Õ£¬ºÍÁ½¸ö×Ö·û´®´¦Àíº¯Êý
 *  ¶ÁÈ¡ÅäÖÃÎļþ½Ó¿Ú £ºint ReadXMLFile(XML_Node_Vector *XmlNodeVector, string filepath);
 *  Ð´ÈëÅäÖ ......

SQL Server¸ù¾Ý²éѯ½á¹û,Éú³ÉXMLÎļþ

SQL Server¸ù¾Ý²éѯ½á¹û,Éú³ÉXMLÎļþ
À´Ô´£º²»Ïê  ×÷ÕߣºØýÃû  Ê±¼ä£º2009-3-6 22:15:58 ·¢²¼£ººÚ¿ÍÈí¼þÔ°
/*
'bcp' ²»ÊÇÄÚ²¿»òÍⲿÃüÁҲ²»ÊÇ¿ÉÔËÐеijÌÐò£¿
¿´¿´ÔÚC:\Program Files\Microsoft SQL Server\80\Tools\BinnÀïÃæÓÐûÓÐbcp.exeÕâ¸öÎļþ
È»ºó¿´¿´pathÀïÃæ¼ÓC:\Program Files\Microso ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ