使用client对象模型读取SharePoint列表数据

使用client对象模型读取SharePoint列表数据

client对象模型提供了强有力的方式。从远程client应用程序管理列表。

1. 管理员身份打开VS,新建项目Windows窗口应用程序,命名ReadSPListData,确保选择.NET Framework 3.5。
2. 加入控件。

控件类型:

3. 你必须加入一个类ProductInfo。
namespace ReadSPListData
{
    class ProductInfo
    {
        public string productName { get; set; }
        public string productSKU { get; set; }
        public string productPrice { get; set; }
    }
}
4. 双击两个button,加入方法。首先是Exit:
        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
5. 然后是Load。

首先要加入合适的引用。右击项目。加入引用Microsoft.SharePoint.Client.dll和Microsoft.SharePoint.Client.Runtime.dll。并在代码中加入using。

你可能会遇到命名空间冲突。加入例如以下代码
using ClientOM = Microsoft.SharePoint.Client;
6. 加入Load代码。

7. 执行截图:

转载于:https://www.cnblogs.com/jzssuanfa/p/7077901.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值