2013年8月26日
摘要: emp.xml内容如下: 1 张 三 2 李 四 3 周 五 4 赵 大// 编写简单的LINQ to XML查询// LinqToXML.csusingSystem;usingSystem.Linq;usingSystem.Xml.Linq;namespaceCh19{classLinqToXml {staticvoidMain(string[] args) {// 加载内存中的XML文档 XE... 阅读全文
posted @ 2013-08-26 02:01 伊利丹 阅读(642) 评论(0) 推荐(0)
摘要: // 编写简单的LINQ to SQL查询// LinqToSQL.csusingSystem;usingSystem.Linq;usingSystem.Data.Linq;usingSystem.Data.Linq.Mapping;namespaceCh19{// [Table]属性将该类标记为实体类,并且有一个或选的Name属性,用于提供表的名称,// 默认为类的名称,如 [Table(Nam... 阅读全文
posted @ 2013-08-26 01:41 伊利丹 阅读(413) 评论(0) 推荐(0)
摘要: // 编写简单的LINQ to Objects查询// LinqtoObjects.csusingSystem;usingSystem.Text;usingSystem.Linq;usingSystem.Collections.Generic;namespaceCh19{classLinqToObjects {staticvoidMain(string[] args) {string[] name... 阅读全文
posted @ 2013-08-26 01:16 伊利丹 阅读(243) 评论(0) 推荐(0)
摘要: // 从文本列中检索数据// RetrieveText.csusingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Data.SqlTypes;usingSystem.IO;namespaceCh18{classRetrieveText {stringtextFile =null;char[] textChars =n... 阅读全文
posted @ 2013-08-26 01:02 伊利丹 阅读(838) 评论(0) 推荐(0)
摘要: // C# 从文件中加载文本数据// LoadText.csusingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Data.SqlTypes;usingSystem.IO;namespaceCh18{classLoadText {staticstringstrFile =@".\LoadText.cs"; SqlCo... 阅读全文
posted @ 2013-08-26 00:37 伊利丹 阅读(563) 评论(0) 推荐(0)