Trong chương này, bạn tìm hiểu về các công cụ khác nhau mà bạn sẽ muốn có trong bộ công cụ phát triển của bạn. Bạn có thể có nhiều hơn hoặc ít hơn những gì được mô tả trong chương này, nhưng cuối cùng chương này là về cốt lõi công cụ phát triển | Programmatically Accessing Lists I 169 true SPList list strSPListName SPListItem Item Item Title strProductName Item Product_SKU strProductSKU Item Price strProductPrice false 11. When you re finished adding the code press F5 to debug the application. When prompted by the UI enter some product information into the dialog as shown in Figure 5-5. FIGURE 5-5 Compiled WPF application using server-side object model 12. Now open your SharePoint site and navigate to the list you updated for example Products list . You will find that the application has updated the SharePoint list as shown in Figure 5-6. IS Title Product_SKU Price Bauer xxxx CCM Tacks CM-TCKS-021 Nike Air NK-AIR-788 Bauer XXVI SHEW BR-XXVI-Ũ90 FIGURE 5-6 Updated list 170 I CHAPTER 5 PROGRAMMING AGAINST SHAREPOINT 2010 LISTS How It Works When you re developing applications that are running on the server you can leverage the server-side object model that is exposed using the Microsoft . For example in this walkthrough you built a simple WPF-based application that was running on the server assuming that you were building and deploying it on your server machine . Very simply the application took a number of string inputs from the WPF UI and used the server-side object model to add this input to a list on your SharePoint site. The five string variables were declared as follows string strSPSiteURL string strSPListName string strProductName string strProductSKU string strProductPrice You ll note that per the earlier example the code leverages the using statements to set the context for the SharePoint site and then sets the Web to allow updates creates an SPList object and SPListltem object and then proceeds to set the specific column fields with the data that was entered by the users. Finally the Update method is called to add the data to the list. using SPSite site new SPSite