手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#使用linq查询大数据集的方法
C#使用linq查询大数据集的方法
摘要:本文实例讲述了C#使用linq查询大数据集的方法。分享给大家供大家参考。具体如下:usingSystem;usingSystem.Colle...

本文实例讲述了C#使用linq查询大数据集的方法。分享给大家供大家参考。具体如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LargeNumberQuery { class Program { static void Main(string[] args) { int[] numbers = CreateNumbers(7384738); Console.WriteLine("Numbers less than 2000:"); var queryResults = from n in numbers where n < 2000 select n; foreach (var item in queryResults) { Console.WriteLine(item); } Console.ReadLine(); } private static int[] CreateNumbers(int count) { Random generator = new Random(0); int[] result = new int[count]; for (int i = 0; i < count; i++) { result[i] = generator.Next(); } return result; } } }

希望本文所述对大家的C#程序设计有所帮助。

【C#使用linq查询大数据集的方法】相关文章:

C# IP地址与整数之间转换的具体方法

c#中判断字符串是不是数字或字母的方法

C#使用非托管代码直接修改字符串的方法

用C#对ADO.NET数据库完成简单操作的方法

C#操作config文件的具体方法

C#访问应用程序配置文件的方法

C# SendKeys使用方法介绍

C# 调用C++写的dll的实现方法

C# 中将数值型数据转换为字节数组的方法

c# 获取数据库中所有表名称的方法

精品推荐
分类导航