Ad

Sunday, February 9, 2014

LINQ To Restriction Operators


Implement a Program using Where Clause:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LinqEx
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = new int[] { 5, 4, 3, 1, 10, 14, 50, 25, 35 };
            Console.WriteLine("Implement a program to display numbers greater than 10 Using LINQ:");
            var mnum = from q in numbers where  q>10 select q;
            foreach (var x in mnum)
            {
                Console.WriteLine(x);
            }
            Console.ReadLine();
        }
    }
}

output:



1 comment:

Unknown said...

I have problem with Oledb Query, while Uploading Excel Sheet to Sql server it is throwing error:"
Error: String was not recognized as a valid DateTime.Couldn't store in DOB Column. Expected type is DateTime."
i tried