pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  1. <tfoot id='PonpU'></tfoot>
      <bdo id='PonpU'></bdo><ul id='PonpU'></ul>

      <small id='PonpU'></small><noframes id='PonpU'>

      <legend id='PonpU'><style id='PonpU'><dir id='PonpU'><q id='PonpU'></q></dir></style></legend>

    1. <i id='PonpU'><tr id='PonpU'><dt id='PonpU'><q id='PonpU'><span id='PonpU'><b id='PonpU'><form id='PonpU'><ins id='PonpU'></ins><ul id='PonpU'></ul><sub id='PonpU'></sub></form><legend id='PonpU'></legend><bdo id='PonpU'><pre id='PonpU'><center id='PonpU'></center></pre></bdo></b><th id='PonpU'></th></span></q></dt></tr></i><div class="2cyiuw0" id='PonpU'><tfoot id='PonpU'></tfoot><dl id='PonpU'><fieldset id='PonpU'></fieldset></dl></div>
    2. 將 XML 文件讀取為 DataSet

      Read XML file as DataSet(將 XML 文件讀取為 DataSet)

      1. <legend id='VVVWG'><style id='VVVWG'><dir id='VVVWG'><q id='VVVWG'></q></dir></style></legend>

              <tbody id='VVVWG'></tbody>

            1. <tfoot id='VVVWG'></tfoot>
            2. <small id='VVVWG'></small><noframes id='VVVWG'>

                <bdo id='VVVWG'></bdo><ul id='VVVWG'></ul>

                <i id='VVVWG'><tr id='VVVWG'><dt id='VVVWG'><q id='VVVWG'><span id='VVVWG'><b id='VVVWG'><form id='VVVWG'><ins id='VVVWG'></ins><ul id='VVVWG'></ul><sub id='VVVWG'></sub></form><legend id='VVVWG'></legend><bdo id='VVVWG'><pre id='VVVWG'><center id='VVVWG'></center></pre></bdo></b><th id='VVVWG'></th></span></q></dt></tr></i><div class="a0wmieo" id='VVVWG'><tfoot id='VVVWG'></tfoot><dl id='VVVWG'><fieldset id='VVVWG'></fieldset></dl></div>
                本文介紹了將 XML 文件讀取為 DataSet的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我對解析 XML 文件沒有經(jīng)驗,我正在將折線圖數(shù)據(jù)保存到 xml 文件中,所以我做了一些研究.根據(jù) this文章,在所有讀取 XML 文件的方法中,DataSet 是最快的.我使用 DataSet 是有道理的,因為可能存在大量數(shù)據(jù).這是我的圖表文檔的外觀:

                I am inexperienced with parsing XML files, and I am saving line graph data to an xml file, so I did a little bit of research. According to this article, out of all the ways to read an XML file, DataSet is the fastest. And it makes sense that I use DataSet since there could be a significant amount of data. Here's how my graph documents look:

                <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
                <BreezyCalc>
                    <Graph Version="3.0" Mode="static">
                        <Range>
                            <X Min="-20" Max="20" />
                            <Y Min="-20" Max="20" />
                        </Range>
                        <Lines>
                            <Line Name="MyLine1" R="0" G="255" B="0">
                                <Point X="-17" Y="9" />
                                <Point X="7" Y="-5" />
                                <Point X="10" Y="4" />
                                <Point X="-6" Y="2" />
                            </Line>
                            <Line Name="MyLine2" R="255" G="0" B="0">
                                <Point X="-7" Y="3" />
                                <Point X="8" Y="-1" />
                                <Point X="-4" Y="-4" />
                                <Point X="-1" Y="6" />
                            </Line>
                        </Lines>
                    </Graph>
                </BreezyCalc>
                

                由于這些線中可能存在大量點,因此我需要以盡可能少的資源盡快獲取數(shù)據(jù).如果有比 DataSet 更快的方法,請賜教.否則,有人可以告訴我如何使用 DataSet 作為我的 XML 解析器來獲取我的圖形數(shù)據(jù)嗎?

                Since there could be a large number of points in these lines, I need to get the data as quickly and with as little resources as possible. If there is a faster approach than DataSet, please enlighten me. Otherwise, could someone show me how I would get my graph data using a DataSet as my XML parser?

                推薦答案

                如果要使用DataSet,很簡單.

                If you want to use a DataSet, it is very simple.

                // Here your xml file
                string xmlFile = "Data.xml";
                
                DataSet dataSet = new DataSet();
                dataSet.ReadXml(xmlFile, XmlReadMode.InferSchema);
                
                // Then display informations to test
                foreach (DataTable table in dataSet.Tables)
                {
                    Console.WriteLine(table);
                    for (int i = 0; i < table.Columns.Count; ++i)
                        Console.Write("	" + table.Columns[i].ColumnName.Substring(0, Math.Min(6, table.Columns[i].ColumnName.Length)));
                    Console.WriteLine();
                    foreach (var row in table.AsEnumerable())
                    {
                        for (int i = 0; i < table.Columns.Count; ++i)
                        {
                            Console.Write("	" + row[i]);
                        }
                        Console.WriteLine();
                    }
                }
                

                如果您想要更快的速度,您可以嘗試使用 XmlReader 逐行讀取.但是開發(fā)難度有點大.你可以在這里看到它:http://msdn.microsoft.com/library/cc189056(v=vs.95).aspx

                If you want something faster, you can try with XmlReader which read line after line. But it is a bit more difficult to develop. You can see it here : http://msdn.microsoft.com/library/cc189056(v=vs.95).aspx

                這篇關(guān)于將 XML 文件讀取為 DataSet的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                Parse malformed XML(解析格式錯誤的 XML)
                <i id='H3gT2'><tr id='H3gT2'><dt id='H3gT2'><q id='H3gT2'><span id='H3gT2'><b id='H3gT2'><form id='H3gT2'><ins id='H3gT2'></ins><ul id='H3gT2'></ul><sub id='H3gT2'></sub></form><legend id='H3gT2'></legend><bdo id='H3gT2'><pre id='H3gT2'><center id='H3gT2'></center></pre></bdo></b><th id='H3gT2'></th></span></q></dt></tr></i><div class="ekqy2kc" id='H3gT2'><tfoot id='H3gT2'></tfoot><dl id='H3gT2'><fieldset id='H3gT2'></fieldset></dl></div>

              • <small id='H3gT2'></small><noframes id='H3gT2'>

                <legend id='H3gT2'><style id='H3gT2'><dir id='H3gT2'><q id='H3gT2'></q></dir></style></legend>

                          <tbody id='H3gT2'></tbody>
                        • <bdo id='H3gT2'></bdo><ul id='H3gT2'></ul>
                        • <tfoot id='H3gT2'></tfoot>

                        • 主站蜘蛛池模板: 常州减速机_减速机厂家_常州市减速机厂有限公司 | 恒温恒湿箱(药品/保健品/食品/半导体/细菌)-兰贝石(北京)科技有限公司 | 苏州伊诺尔拆除公司_专业酒店厂房拆除_商场学校拆除_办公楼房屋拆除_家工装拆除拆旧 | 广州市哲铭油墨涂料有限公司,水性漆生产研发基地 | 生物除臭剂-除味剂-植物-污水除臭剂厂家-携葵环保有限公司 | 丽陂特官网_手机信号屏蔽器_Wifi信号干扰器厂家_学校考场工厂会议室屏蔽仪 | 广州展览制作工厂—[优简]直营展台制作工厂_展会搭建资质齐全 | 小型手持气象站-空气负氧离子监测站-多要素微气象传感器-山东天合环境科技有限公司 | 儋州在线-儋州招聘找工作、找房子、找对象,儋州综合生活信息门户! | 七维官网-水性工业漆_轨道交通涂料_钢结构漆 | 执业药师报名条件,考试时间,考试真题,报名入口—首页 | 氧化铝球_高铝球_氧化铝研磨球-淄博誉洁陶瓷新材料有限公司 | 篷房|仓储篷房|铝合金篷房|体育篷房|篷房厂家-华烨建筑科技官网 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 深圳市超时尚职业培训学校,培训:月嫂,育婴,养老,家政;化妆,美容,美发,美甲. | 合金耐磨锤头_破碎机锤头_郑州市德勤建材有限公司 | 聚合氯化铝价格_聚合氯化铝厂家_pac絮凝剂-唐达净水官网 | 安全阀_弹簧式安全阀_美标安全阀_工业冷冻安全阀厂家-中国·阿司米阀门有限公司 | 基本型顶空进样器-全自动热脱附解吸仪价格-AutoHS全模式-成都科林分析技术有限公司 | 2025黄道吉日查询、吉时查询、老黄历查询平台- 黄道吉日查询网 | 飞象网 - 通信人每天必上的网站 全球化工设备网—化工设备,化工机械,制药设备,环保设备的专业网络市场。 | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | RFID电子标签厂家-上海尼太普电子有限公司 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | 酵素生产厂家_酵素OEM_酵素加盟_酵素ODM_酵素原料厂家_厦门益力康 | 合肥白癜风医院_[治疗白癜风]哪家好_合肥北大白癜风医院 | SMN-1/SMN-A ABB抽屉开关柜触头夹紧力检测仪-SMN-B/SMN-C-上海徐吉 | 智能电表|预付费ic卡水电表|nb智能无线远传载波电表-福建百悦信息科技有限公司 | 螺纹三通快插接头-弯通快插接头-宁波舜驰气动科技有限公司 | 中医中药治疗血小板减少-石家庄血液病肿瘤门诊部 | 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 | UV固化机_UVLED光固化机_UV干燥机生产厂家-上海冠顶公司专业生产UV固化机设备 | 嘉兴恒升声级计-湖南衡仪声级计-杭州爱华多功能声级计-上海邦沃仪器设备有限公司 | 光泽度计_测量显微镜_苏州压力仪_苏州扭力板手维修-苏州日升精密仪器有限公司 | 福州时代广告制作装饰有限公司-福州广告公司广告牌制作,福州展厅文化墙广告设计, | 篷房|仓储篷房|铝合金篷房|体育篷房|篷房厂家-华烨建筑科技官网 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 北京发电机出租_发电机租赁_北京发电机维修 - 河北腾伦发电机出租 | 冻干机(冷冻干燥机)_小型|实验型|食品真空冷冻干燥机-松源 | 体坛网_体坛+_体坛周报新闻客户端| 悬浮拼装地板_幼儿园_篮球场_悬浮拼接地板-山东悬浮拼装地板厂家 | 协议书_协议合同格式模板范本大全 | 螺纹三通快插接头-弯通快插接头-宁波舜驰气动科技有限公司 |