Thursday, July 10, 2008

LINQ

create a new Visual C# LINQ Windows Application project using Visual Studio 2005. Notice that the Visual Studio automatically adds the following LINQ namespaces.

using System.Query;
using System.Data.DLinq;
using System.Xml.XLinq;
Buttonclick for using length
{
string[] Emp= {"Balachandran", "chandran", "Bala", "Boss", "Rose", "Ram"};
IEnumerable Findthelength=
from Emp in Employeees
where Employeees.Length < 5
select Employeees;
foreach(var Employeeesin Findthelength)
{
Messagebox.show(Employeees);
continue
}
}

Buttonclick for using Startswith
{
string[] Emp= {"Balachandran", "chandran", "Bala", "Boss", "Rose", "Ram"};
IEnumerable Findthelength=
from Emp in Employeees
where Employeees.startswith("B")
select Employeees;
foreach(var Employeeesin Findthelength)
{
Messagebox.show(Employeees);
continue
}
}
}

No comments: