WEB开发网
开发学院WEB开发ASP.NET 怎么样在sharepoint 2010 中操作List的办法 阅读

怎么样在sharepoint 2010 中操作List的办法

 2010-11-06 14:20:29 来源:WEB开发网   
核心提示: /// <summary> /// 删除栏 /// </summary> /// <param name="sender"></param> /// <param name=
        /// <summary>
        /// 删除栏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAddField_Click(object sender, EventArgs e)
        {
            using (SPSite site = new SPSite(requestUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    string listName = txtFieldList.Text.Trim();
                    SPList list = web.Lists[listName];
                    //list.Fields.Delete("Price");     //删除栏

                    //list.Update();
                }
            }
        }

 
        /// <summary>
        /// 修改栏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAddField_Click(object sender, EventArgs e)
        {
            using (SPSite site = new SPSite(requestUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    string listName = txtFieldList.Text.Trim();
                    SPList list = web.Lists[listName];
                    
                    //修改栏
                    //list.Fields["标题"].Title = "Title";     
                    //list.Fields["标题"].Update();

                    //list.Update();
                }
            }
        }

 
            using (SPSite site = new SPSite(requestUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList bookList = web.Lists["Books"];
                    SPListItem item = bookList.Items.Add();
                    item["Title"] = "流氓是怎么炼成的";
                    item["ISBN"] = "12345";
                    item["LeadAuthor"] = "abc";
                    item.Update();
                }
            }

 (SharePoint 2010)用户代码未处理 FileNotFoundException

http://tech.cncms.com/develop/c/111690.html

上一页  1 2 

Tags:sharepoint List

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接