摘要: static List<int> Given50RandomNumbers() { List<int> intList = new List<int>(); for(int i=1;i<=50;i++) { intList.Add(i); } if(intList.Count>0) { return 阅读全文
posted @ 2016-10-18 00:18 FredGrit 阅读(670) 评论(0) 推荐(0) 编辑
摘要: 索引是与表或视图关联的磁盘上结构,可以加快从表或视图中检索行的速度。 索引包含由表或视图中的一列或多列生成的键。 这些键存储在一个结构(B 树)中,使 SQL Server 可以快速有效地查找与键值关联的行。 表或视图可以包含以下类型的索引: 群集 聚集索引根据数据行的键值在表或视图中排序和存储这些 阅读全文
posted @ 2016-10-08 20:00 FredGrit 阅读(472) 评论(0) 推荐(0) 编辑
摘要: The Control Template defines the visual appearance of a control. All of the UI elements have some kind of appearance as well as behavior, e.g., Button 阅读全文
posted @ 2016-10-08 19:50 FredGrit 阅读(163) 评论(0) 推荐(0) 编辑
摘要: public static void SortByOddAndEven(int []arr) { for (int i = 0; i < arr.Length; i++) { for (int j = arr.Length - 1; j >= i; j--) { if (arr[i] % 2 == 阅读全文
posted @ 2016-10-08 18:59 FredGrit 阅读(815) 评论(0) 推荐(0) 编辑
摘要: using System.Data.Linq;using System.Data.Linq.Mapping; namespace ConsoleApplication1388{ class Program { static void Main(string[] args) { string sour 阅读全文
posted @ 2016-10-06 14:50 FredGrit 阅读(464) 评论(0) 推荐(0) 编辑
摘要: using System.Data.Linq;using System.Data.Linq.Mapping; namespace ConsoleApplication1388{ class Program { static void Main(string[] args) { string sour 阅读全文
posted @ 2016-10-06 14:34 FredGrit 阅读(322) 评论(0) 推荐(0) 编辑
摘要: LINQ to SQL will translate .NET methods in this manner: text.StartsWith(...) = LIKE ...% text.Contains(...) = LIKE %...% text.EndsWith(...) = LIKE %.. 阅读全文
posted @ 2016-10-06 11:56 FredGrit 阅读(379) 评论(0) 推荐(0) 编辑
摘要: using (AdventureWorks2012Entities db = new AdventureWorks2012Entities()) { int num = (from stu in db.Customer orderby stu.CustomerID select stu).ToLis 阅读全文
posted @ 2016-10-06 11:19 FredGrit 阅读(672) 评论(0) 推荐(0) 编辑
摘要: object[] vals = { 1, "Hello", true, "World", 9.1 }; IEnumerable<double> justStrings = vals.OfType<double>( ); foreach(var str in justStrings) { Consol 阅读全文
posted @ 2016-10-05 16:38 FredGrit 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 转自, http://www.cnblogs.com/kingcat/archive/2012/07/11/2585943.html yield return 表示在迭代中下一个迭代时返回的数据,除此之外还有yield break, 其表示跳出迭代,为了理解二者的区别我们看下面的例子 class A 阅读全文
posted @ 2016-10-05 13:54 FredGrit 阅读(242) 评论(0) 推荐(0) 编辑