C#使用linq查询大数据集的方法
生活随笔
收集整理的這篇文章主要介紹了
C#使用linq查询大数据集的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這篇文章主要介紹了C#使用linq查詢大數據集的方法,涉及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 numberswhere n < 2000select 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查询大数据集的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 世界上第一台现代计算机是什么
- 下一篇: Oracle 11g安装步骤