Create a SharePoint Lists reader (Windows Store apps using C# and XAML)

Accessing SharePoint Lists by Using WCF Data Services in Windows 8 app


This walkthrough shows how to create a Windows 8 app that displays SharePoint Announcement, Tasks, Calendar and Documents lists information by using the ListData.svc WCF data service .

You can download the complete Visual Studio project for this tutorial from CodePlex. Download the source code. You can also view the source code on the this page.




Prerequisites


Creating a Windows Store Application

  1. Launch Visual Studio 2012 and select File > New Project.
  2. Create a new Visual C# project using the Grid Application template.
  3. Add a Service Reference. In Solution Explorer, right-click the name of the project and then click Add Service Reference.
  4. In the Address box, type the URL to the target site and append /_vti_bin/ListData.svc.
  5. Change the default name in the Namespace box from ServiceReference1 to something more appropriate, such as SharePointService.
  6. Click OK to create proxy classes, including a data context and entity classes for the lists that you want to access.

Creating the DataSource for the Grid

  1. Right mouse click on the "DataModel" folder and add a new class and call the new class SharePointDataSource.cs
  2. Add the following namespace references. using SharePointLists.SharePointService;
    using System.Data.Services.Client;
    using System.Net;
    using System.Text.RegularExpressions;
    using Windows.UI.Xaml.Media;
    using System.Collections.ObjectModel;
    using Windows.UI.Xaml.Media.Imaging;
    using System.Collections.Specialized;
  3. Add the following variable declarations at the top of the class.
    private static SharePointDataSource _SharePointDataSource = new SharePointDataSource()

    private DataServiceCollection<AnnouncementsItem> announcements = new DataServiceCollection<AnnouncementsItem>();

    private DataServiceCollection<SharedDocumentsItem> sharedDocuments = new DataServiceCollection<SharedDocumentsItem>();

    private DataServiceCollection<CalendarItem> calendar = new DataServiceCollection<CalendarItem>();

    private DataServiceCollection<TasksItem> tasks = new DataServiceCollection<TasksItem>();

    private TeamSiteDataContext context;

    private ObservableCollection<SharePointDataGroup> _allGroups = new ObservableCollection<SharePointDataGroup>();
  4. Replace the constructor with the following:
    public SharePointDataSource()



    {
    context = new TeamSiteDataContext(new Uri("http:///_vti_bin/ListData.svc"));

    NetworkCredential credentials = new NetworkCredential();

    context.UseDefaultCredentials = false;

    context.Credentials = new NetworkCredential("username", "password", "domain");

    announcements = new DataServiceCollection<AnnouncementsItem>();



    announcements.LoadAsync(context.Announcements);
    announcements.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(announcements_LoadCompleted);

    tasks = new DataServiceCollection<TasksItem>();



    tasks.LoadAsync(context.Tasks);
    tasks.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(tasks_LoadCompleted);

    calendar = new DataServiceCollection<CalendarItem>();



    calendar.LoadAsync(context.Calendar);
    calendar.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(calendar_LoadCompleted);

    sharedDocuments = new DataServiceCollection<SharedDocumentsItem>();



    sharedDocuments.LoadAsync(context.SharedDocuments);
    sharedDocuments.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(sharedDocuments_LoadCompleted);



    }
  5. Add the following Load completed procedures for each list:void announcements_LoadCompleted(object sender, LoadCompletedEventArgs e)
    void sharedDocuments_LoadCompleted(object sender, LoadCompletedEventArgs e)
    void tasks_LoadCompleted(object sender, LoadCompletedEventArgs e)
    void calendar_LoadCompleted(object sender, LoadCompletedEventArgs e)
     
  6. Download or view the complete SharePointDataSource.cs here and be sure to replace the "Servername", "username", "password" and "domain" with the server and credentials of your server that's running SharePoint.
  7. Make sure to replace the DataSource on you project. Find all data:SampleDataSource in the xaml files, and replace it with data:SharePointDataSource. And in the xaml.cs files replace all SampleDataSource with SharePointDataSource.
  8. Run your app :)
Previous
Next Post »
266 Komentar
«Oldest   ‹Older   201 – 266 of 266   Newer›   Newest»
avatar

While creating checks while processing payment in QuickBooks Payroll Support Phone Number online, a few which you have an effective record of previous payrolls & tax rates. This can be required since it isn’t easy to make adjustments in qbo in comparison to the desktop version.

Balas
avatar

QuickBooks Enterprise features its own awesome features which could make it more reliable and efficient. Let’s see some awesome features that could have caused it really is so popular. If you are also a QuickBooks user and desires to find out more concerning this software you may have a look at QuickBooks Enterprise Support Number.

Balas
avatar

Common problems addressed by the consumer care unit that answers calls include Returns, Cancel order, Change order, tech support team, Track order and other customer support issues. In place of attempting to call QuickBooks we advice you tell us what issue you will be having and then possibly contact them via phone or web or chat. As a whole, QuickBooks has QuickBooks Support Phone Number USA.

Balas
avatar

Are you wandering here and there in order to search for the correct means to run the QuickBooks Enterprise software for your business? We have come with a lot of permanent solutions to fix your problems in a few seconds with an ideal QuickBooks Enterprise customer support. Just dial our QuickBooks Enterprise Support Number to contact QuickBooks enterprise help team anytime & anywhere.

Balas
avatar

We have a good source for the users as well as professionals and i.e. community page where you can learn various features and read tutorials. You can put your queries here and get a brief answer from the community experts. In case of instant help, it’s better to connect with a QuickBooks Tech Support Number.

Balas
avatar

The nonprofit organizations have been set up for various causes. This software is helpful to maintain the list of your donors by providing you data storage and security. This non-profit version of QuickBooks Enterprise has all the versions of QuickBooks. This non-profit version has enough storage capacity for vendors, donors and items. Reports generation is a very critical task but QuickBooks enterprise has provided easy way in handling advanced reports. For any type of help, one can contact QuickBooks Enterprise Support Phone Number anytime by dialing our toll-free helpline number.

Balas
avatar

Loan Manager will generate the proper loan repayment test every payment interval, once again saving time, reducing errors and increasing precision. In the event of errors, to access the expert services, dial QuickBooks Premier Support Phone Number and also for the application, go to Loan Supervisor, to your Banking menu.

Balas
avatar

The experts at our QuickBooks Enterprise Tech Support Phone Number have the necessary experience and expertise to deal with all issues associated with the functionality of the QuickBooks Enterprise.

Balas
avatar

QuickBooks Tech Support Phone Number has indeed developed an excellent software product to manage the financial needs associated with the small and medium-sized businesses. The name regarding the application is QuickBooks. QuickBooks, particularly, doesn't have any introduction for itself. But one who is unknown to this great accounting software, we wish one to give it a try.

Balas
avatar

Intuit QuickBooks Support Number for all the versions are offered under one-roof and it can be discussed by attaining the customer support number. The QuickBooks support telephone number is toll-free in addition to professional technicians handling your support call will come up with an immediate solution that may permanently solve the glitches.

Balas
avatar

While installing QuickBooks Pro at multiple computer systems or laptops, certain bugs shall disturb the initial set up process. This installation related problem might be solved by permitting the executives who will be handling the QuickBooks Tech Support Phone Number understand the details pertaining to your license along with date of purchase of the product to instantly solve the put up related issue.

Balas
avatar

QuickBooks Premier is a favorite product from QuickBooks recognized for letting the business people easily monitor their business-related expenses; track inventory at their convenience, track the status of an invoice and optimize the data files without deleting the information.QuickBooks Tech Support is available 24/7 to produce much-needed integration related support.

Balas
avatar


Intuit has been developing constructive multiple versions of QuickBooks Tech Support that shall meet up with your business purpose in one way or another. Their widely available accounting software versions and packages are unique from one another and they can be chosen based upon your business type and workflow.

Balas
avatar

QuickBooks Customer Care Telephone Number: Readily Available For every QuickBooks Version.Consist of a beautiful bunch of accounting versions, viz.,QuickBooks Pro, QuickBooks Premier, QuickBooks Enterprise, QuickBooks POS, QuickBooks Mac, QuickBooks Windows, and QuickBooks Payroll, QuickBooks has grown to become a dependable accounting software that one may tailor depending on your industry prerequisite. As well as it, our QuickBooks Technical Support Number will bring in dedicated and diligent back-end helps for you for in case you find any inconveniences in operating any of these versions.

Balas
avatar

The error comes while you're in the exact middle of trying to find something online and the thing is that banking error 9999. The error could cause the device to hang, run slowly or even are amiss. Also when the accounting professionals are making an effort to update the lender information, they are able to get entangled using this error. If you would like to take a shot to Troubleshoot QuickBooks Error 9999 yourself, you can continue reading this blog.

Balas
avatar

You can directly report the issue if you feel the need. If you would like to take a shot at fixing it yourself, you can continue reading this blog. Fix QuickBooks Error 9999

Balas
avatar

Just simply clearing the “Cache” resolves many issues, this can work for Quickbooks Error 9999 as well.

Balas
avatar

Situs Judi Terpercaya Crown303
PROMO di Crown303 :

*Bonus New Member 10%
*Bonus Next Depo 5%
*Bonus Mix Parlay Jutaan Rupiah.
*Bonus Cashback 10%
*Bonus Rollingan Casino 0,8%
*Bonus Referral 10%

Agen Bola Terpercaya
Daftar SBOBET
Daftar Judi Online
Bandar Judi Bola
Agen SBOBET Casino
Situs Judi Online
Agen Bola Euro 2020
Agen Bola Online

WHATSAPP : +6281807160790

Balas
avatar

It is very good and useful for students and developer.Learned a lot of new things from your post. Salesforce Training Australia is a best institute for Salesforce Course.

Balas
avatar

Thanks for provide great informatic and looking beautiful blog, really nice information. oracle training in chennai

Balas
This comment has been removed by the author. - Hapus
This comment has been removed by the author. - Hapus
avatar

The most attractive thing is that candidates can opt multiple Institute.


ดูหนังฟรี2022
dramaslist2u.com

Balas
avatar

I just browsing through some blogs and came across yours!Excellent blog

ดูหนังฟรี2022
dramaslist2u.com

Balas
avatar

WOW, coding in a window, nice. After reading your blog, I feel like Software developer. Thanks for sharing.
For you, If you want to travel any destination, I will provide you best deal, just because you shared a very knowledgable blog. Thank you so much. We are a Best travel agency in Noida.

Balas
avatar

Thanks for this article. I really like it. It's very helpful for me. Thanks again for this article. please contact me back. รับทำบัญชี

Balas
This comment has been removed by the author. - Hapus
«Oldest   ‹Older   201 – 266 of 266   Newer›   Newest»