Validating textbox in c net

22 Feb

If you are used to using SQL to query databases, you are going to have something of a head start with Linq, since they have many ideas in common.

Before we dig into Linq itself, let's step back and look at what makes SQL different from C#. For this example, we will imagine they are stored in memory, but they could be in a file on disk too.

If you type this query into the IDE yourself, you will notice that it has worked out that "o" is an Order and intellisense works as expected.

Thankfully, in most cases that mistake will lead to a compile time error anyway.For example you can perform a join to find all the customers and distributors who have the same location.In LINQ the When working with the LINQ queries for SQL one of the common queries that we need to run is the select query with IN clause.Remembering the projection syntax, we can shorten this to: And obtain the same result.Note that you can perform whatever computation you wish inside the anonymous type initializer.