zoukankan      html  css  js  c++  java
  • 向sharepoint 2010 中的列添加数据 muddy

     1   string url = SPContext.Current.Web.Url;
    2 Uri siteUrl = new Uri(url);
    3 using (SPWeb spWeb = new SPSite("http://" + siteUrl.Host).OpenWeb())
    4 {
    5 spWeb.AllowUnsafeUpdates = true;
    6 //获取CreateNewPro列表信息
    7 SPListItemCollection SPCollCreateNewPro = spWeb.Lists["CreateNewPro"].Items;
    8 SPListItem spListItem = SPCollCreateNewPro.Add();
    9 spListItem["CreatePMO"] = PmoText.Text;
    10 spListItem["ProName"] = ProText.Text;
    11 spListItem["InputUnit"] = InputUnitText.Text;
    12 spListItem["Department"] = DepartmentText.Text;
    13 foreach (Control radio in this.Panel1.Controls)
    14 {
    15 if (radio.GetType().Name == "RadioButton")
    16 {
    17 if (((RadioButton)radio).Checked)
    18 {
    19 spListItem["ProType"] = ((RadioButton)radio).Text;
    20 }
    21 }
    22
    23 }
    24 spListItem["CreateTime"] = CreateTime.Text;
    25 spListItem.Update();
    26 int a = spListItem.ID; //获取新插入的Item的编号
  • 相关阅读:
    windows常用命令行总结
    express安装
    MySQL去除外键关联关系
    c#实体转化
    C#之Clone
    mysql 将null转代为0(转)
    Mysql显示行号
    mysql存储过程游标加计划任务事件调度器
    mysql临时表
    Git学习笔记
  • 原文地址:https://www.cnblogs.com/muddy/p/2366209.html
Copyright © 2011-2022 走看看