Having clause and Grouping Based on condition in LINQ

Hi,

While querying with LINQ, some times we will have to use the group By clause. But many a times we also want to use the having clause of SQL with the group by clause in the LINQ. There is no direct having keyword in LINQ to do this we need to use the where clause itself.

You can query the LINQ to SQL to have both Group By and Having like this.

Continued...

LINQ queries and IN clause in SQL

Hi,

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. In SQL IN clause is used to provide more than one value to match in the where clause.

Something like the query below

Select * from Table
where column1 in (‘Value1’, ‘Value2’, ‘Value3’)

To do a similar query in LINQ we can use

var list = from t in table
                where t.column1 = Value1’
                And t.column1 = Value2’
                t.column1 = Value3’
                Select t

Continued...

A workshop for IT Professionals on 15th September on Implementing SECURITY INSIDE-OUT with MICROSOFT Technologies
Hi,

There an interactive live session on September 15, 2009 on how the New Efficiency Products will help you manage security in a simpler way. This session will occur across 16 cities at NIIT centers as a live session with benefit of face-to-face teaching, each participant having their own computers to work on, and having the ability to ask questions any time. The following event is available for the following city.

Ahmedabad       
Lucknow
Bangalore          
Mumbai
Bhopal 
Mysore
Bhubhaneswar  
Nagpur
Chandigarh        
Nasik
Chennai              
New

Continued...

How to know when the application is running in Localhost or debugging mode

Hi,

Most of the time (If not all) when working on the project we view the website with the help of localhost in debugging mode. Many a times when working on some modules, for solving small problem, we want to write some code that should execute only when running in the localhost or debugging environment.

Normally developers would write the code and then take it as their responsibility to remove the code before the code goes to the next environment. But some time we might make a mistake of not removing the code and letting it go to the next environment, which can cause a lots of trouble.

In these kinds of circumstances and Asp.Net developer can take help of the IsLocal method of the Request class. The method will return true in case the application is running from localhost.

Continued...

How to change the default profile setting in Visual Studio

Hi,

While working with Visual Studio, was that normally we have to select the profile setting (Visula Basic profile, C# profile, web development profile etc...) when we start the Visual Studio for the first Times. But Many a time after working on a type of project for some time you start working on other types of project.

For Example, Currently I am working on a Windows Applictaion (With Language VB.Net) But before this project I was Working on Web Development in C#, and before that Windows Development in C#.

In Visual studio you can easily change the profile of the IDE by going to Tools -> Import Export Settings. This brings up Import Export Windows Wizard. Follow the simple Wizard (which also allows to save you the current settings  for future use) and seletc the new profile setting (based on the kind of project you are working on) and you are ready to work with new profile.

Vikram

Continued...
 
Copyright © 2006 - 2010 Vikram Lakhotia