欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#使用linq查詢大數(shù)據(jù)集的方法

 更新時(shí)間:2015年04月02日 09:56:30   作者:令狐不聰  
這篇文章主要介紹了C#使用linq查詢大數(shù)據(jù)集的方法,涉及C#調(diào)用linq進(jìn)行數(shù)據(jù)查詢的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了C#使用linq查詢大數(shù)據(jù)集的方法。分享給大家供大家參考。具體如下:

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;
    }
  }
}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論