Friday, February 15, 2013

Concatenate Columns in SQL


In this way we can concatenate two columns in SQL:

  SELECT 
  
  CONVERT(NVARCHAR(50),[COLUMN_1] 
  + '-'+ 
  CONVERT(NVARCHAR(50),[COLUMN_2])) AS COMBINED 
  
  FROM [TABLE_1]
  WHERE [COLUMN_1] = 'SOME_THING'

Tuesday, February 12, 2013

List.ToLookup Example in C#



Sometimes when we have a list of objects and we need to look up that collection by a member item in the object, we could easily benefit from converting a List collection into a Lookup collection. For example, we need to look up an entire product's inventory in a store by their Supply Date or by their price etc.
             So, to get a Lookup from a list we use the extension method "ToLookup" available in a List collection's extension methods.

I wrote an article on this topic recently for CShap Corner Site. Please go through following link:

http://www.c-sharpcorner.com/UploadFile/0f68f2/creating-a-lookup-from-a-list-of-objects-using-lambda-expres/


Friday, February 1, 2013

Set page orientation of specific page in MS-Word


We can set page orientation of only specific pages in a document to 'Landscape' while others pages in the document have different page orientation (i.e. Protrait). I wrote an article explaing 'How To Do' in the C-Sharp Corner site. Here is the link:

http://www.c-sharpcorner.com/UploadFile/0f68f2/how-to-set-page-orientation-of-only-individual-page-in-ms-wo/

Thanks,
Hemant