home screen

Search



Number Of Result : 0

Result :


Friday, June 11, 2010

Generate Linq-to-SharePoint proxy class to access list data - SharePoint 2010

- In this task, you will use the new spmetal.exe to generate the necessary Linq-to-SharePoint proxy code.

- In the Solution Explorer, right-click on any your project and select Open Folder in Windows Explorer.

- Hold Shift key, right-click anywhere in the Explorer Window, and select Open Command Window Here to open the command prompt window in the current project directory.

- Type the following command in the command prompt and press Enter key to set the path to the SharePoint 2010 folder:
set path=%path%;c:\program files\common files\microsoft shared\web server extensions\14\bin

- Type the following command in the command prompt and press Enter key to generate the Linq proxy code:
spmetal.exe /web:http://intranet.contoso.com /namespace:SPCHOL302_Ex1.SPLinqDemoWebPart /code:SPLinq.cs

- After that current folder will apprear a SPLinq file.

- Add Reference:
+ In the Solution Explorer, right-click on References and select Add Reference
+ Switch to Browse tab and in the File Name textbox enter C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI. Press Enter.
+ Select Microsoft.SharePoint.Linq.dll, and press OK.

No comments: