C#  读取XML 数据  并与  SQL数据库数据进行比较  不同的列出来  (C/S 结构)

解决方案 »

  1.   

    C# 如何查询\增加\删除XML 中的数据呢?  数据量比较大
      

  2.   

    Configuration config = ConfigurationManager.OpenMappedExeConfiguration(strPath)
    YourSection yourSection = config.GetSection("SectionName") as YourSection ;
    然后就可以进行相关操作了晕。这种问题还真多人问。。
    呵呵。不过我也就会点这种得。
    JF
      
    PS:vs2005
      

  3.   

    MS的这个类。用着相当的爽。不过对于自定义的section要写section类才可以解析
    模式都一样。
      

  4.   

    例子给你了阿
    你用关键字去msdn查下酒可以了。
    不会的再问。
      

  5.   

    /// <summary>
            /// 从XML中删除相应的数据(仅适用于网站和程序的设置)
            /// </summary>
            /// <param name="theNode">要删除数据所在的结点</param>
            /// <param name="xmlName">删除结点的名字</param>
            protected void DeleteXMLNode(XmlNode theNode, string xmlName)
            {
                XmlNodeList xnl = theNode.ChildNodes;
                foreach (XmlNode xe in xnl)
                {
                    if (xe.InnerText == xmlName)
                        theNode.RemoveChild(xe);
                }
            }
      

  6.   

    /// <summary>
            /// 用于将用户新设置的网站或程序实际写入到XML中去
            /// </summary>
            /// <param name="theNode">要添加到的NODE结点</param>
            /// <param name="arrList">数据源</param>
            protected void WriteToXML(XmlNode theNode, ArrayList arrList)
            {
                foreach(string thename in arrList)
                {
                xmlElem = xmlDoc.CreateElement("Name");
                xmlElem.InnerText = encryer.Encrypto(thename);
                theNode.AppendChild(xmlElem);
                }            
            }