Wednesday, December 30, 2009

LINQ to SharePoint –PART-II

In this Part-II i am going to show you how to perform CURD Operations on SharePoint custom list using LINQ to SharePoint provider. Here i am going to use the custom list which we used in Part-I.

DataContext class is the main class which will keep tracks of Entity changes. DataContext class has SubmitChanges method using this we can save the List item .

image

Datacontext Class SubmitChanges() method:

  image

Code snippet to create new Item and saves to SharePoint List

image

List Items Before Inserting new Item

image

List Items after Inserting new Item

image

Same way we can use DataContect object to do Update , Delete Item on List as well using LINQ to SharePoint.

Nandri(Thanks)

SreenivasaRagavan

No comments: