How to Access SharePoint Data using C# : Adding Data to a SharePoint List Using Data from Another SharePoint List / PDF
How to Access SharePoint Data using C# : Adding Data to a SharePoint List Using Data from Another SharePoint List / PDF
Overview
SharePoint is an excellent tool for centralizing communications for a project team, department or
company. Developers can also write programs that can take SharePoint’s functionality to the next level.
For example, a developer can write a program to take survey data and create a robust report based on
the survey data.
There are two ways you can reference SharePoint when writing code:
• Reference and use the classes the Microsoft.Sharepoint library
• Make a web reference to the SharePoint services.
While referencing and using the classes in the Microsoft.SharePoint library is the easier coding method of
the two, it requires that you run the program on the same server as SharePoint. You may have a
situation where you don’t want to run the code on the same server as SharePoint. For example, I needed
to write a program that took data from a survey list, make calculations with the data, and put the
calculated and summarized data in a new list. Because of our current SharePoint architecture, I didn’t
really want to run the code on the same server because it would require me to move my code to the
production SharePoint server, log in to the production server, and run the code.
This series will demonstrate how to access SharePoint data “behind the scenes” without having to run the
program on the SharePoint server. In Part 1 of this series, I demonstrated how to access the SharePoint
service using a web reference as well as how to access a list. In Part 2 of this series, I demonstrated how
to actually extract the data in the list. In Part 3 of this series, I will demonstrate how to add data to a
SharePoint list using the program.
Scenario for this Illustration
The site has a survey where users answer a few questions (see Figures 1 and 2). The assignment is to
use a program to access the survey so the results can be evaluated, and some of the survey information
can be added to a separate list (see Figure 3).
If you have already followed the tutorial for Parts 1 and 2 of this series, you should have already created a
project called SPBehindTheScenes. We will be modifying that project for this tutorial.......
Overview
SharePoint is an excellent tool for centralizing communications for a project team, department or
company. Developers can also write programs that can take SharePoint’s functionality to the next level.
For example, a developer can write a program to take survey data and create a robust report based on
the survey data.
There are two ways you can reference SharePoint when writing code:
• Reference and use the classes the Microsoft.Sharepoint library
• Make a web reference to the SharePoint services.
While referencing and using the classes in the Microsoft.SharePoint library is the easier coding method of
the two, it requires that you run the program on the same server as SharePoint. You may have a
situation where you don’t want to run the code on the same server as SharePoint. For example, I needed
to write a program that took data from a survey list, make calculations with the data, and put the
calculated and summarized data in a new list. Because of our current SharePoint architecture, I didn’t
really want to run the code on the same server because it would require me to move my code to the
production SharePoint server, log in to the production server, and run the code.
This series will demonstrate how to access SharePoint data “behind the scenes” without having to run the
program on the SharePoint server. In Part 1 of this series, I demonstrated how to access the SharePoint
service using a web reference as well as how to access a list. In Part 2 of this series, I demonstrated how
to actually extract the data in the list. In Part 3 of this series, I will demonstrate how to add data to a
SharePoint list using the program.
Scenario for this Illustration
The site has a survey where users answer a few questions (see Figures 1 and 2). The assignment is to
use a program to access the survey so the results can be evaluated, and some of the survey information
can be added to a separate list (see Figure 3).
If you have already followed the tutorial for Parts 1 and 2 of this series, you should have already created a
project called SPBehindTheScenes. We will be modifying that project for this tutorial.......
How to Access SharePoint Data using C# : Adding Data to a SharePoint List Using Data from Another SharePoint List / PDF
0 commentaires: