August 29, 2012

LINQ Queries



Here are sample linq queries:
 
1) results2 = (from a in myBrandsSite.LibraryBrandDiseaseList
                where (a.LibraryID != null && 
                       a.LibraryID.ExpirationDate >= DateTime.Today && 
                       arrayBrands.Contains(a.Brand.Title))
                select a ).ToList();
 
-- Here in the above query arrayBrands is a string array with selected options and 
   (a.Brand.Title) is the option value present in a list. 
-- The above query executes and fetches all the records which are not null and not 
   expired and fetches the data which have a value.
-- The  


August 24, 2012

Working with LINQ

Definition: LINQ [Language Integrated Query] defines a set of method names (called standard query operators, or standard sequence operators), along with translation rules from so-called query expressions to expressions using these method names, lambda expressions and anonymous types. These can, for example, be used to project and filter data into arrays, enumerable classes, XML (LINQ to XML), relational databases, and third party data sources.

Sample Query

results = (from a in myBrandsSite.LibraryBrandDiseaseList
                 where (a.LibraryID != null )
                 select a
                  ).ToList();

In the above sample query, [myBrandsSite.LibraryBrandDiseaseList] is the object[EntityList] which refers all the data from the list.
After that we filter the data from the [EntityList] with a condition.which stores the filtered data in [results].

Migrate SharePoint 2010 Infopath to SharePoint Online

 Below are the steps to follow to migrate the Infopath data to SP Online.