摘要: public static SPFieldUserValue GetUserValue(string name) { SPFieldUserValue userColl = new SPFieldUserValue(); SPSecurity... 阅读全文
posted @ 2014-07-15 11:25 Toby Wang 阅读(202) 评论(0) 推荐(0)
摘要: protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "delete") { ... 阅读全文
posted @ 2014-07-15 11:24 Toby Wang 阅读(641) 评论(0) 推荐(0)
摘要: FileStream fileStrem = new FileStream(templatePath, FileMode.Open); long fileSize = fi... 阅读全文
posted @ 2014-07-15 11:19 Toby Wang 阅读(438) 评论(0) 推荐(0)
摘要: 等等using System;using Microsoft.SharePoint;using Microsoft.SharePoint.WebControls;using Microsoft.Office.Interop.Excel;using System.Web;using System.Da... 阅读全文
posted @ 2014-07-15 11:18 Toby Wang 阅读(442) 评论(0) 推荐(0)
摘要: /// /// Excel导入DataTable /// /// 文件名称 /// 是否包含表头 /// Sheet /// 错误信息 /// 导入的Excel的开始行 ... 阅读全文
posted @ 2014-07-15 11:14 Toby Wang 阅读(414) 评论(0) 推荐(0)
摘要: using System;using Microsoft.SharePoint;using Microsoft.SharePoint.WebControls;using Microsoft.Office.Interop.Excel;using System.Data;using System.Web... 阅读全文
posted @ 2014-07-15 11:13 Toby Wang 阅读(532) 评论(0) 推荐(0)
摘要: public static System.Data.DataTable GetDataTable( int parentId, SPList list ,System.Data.DataTable dt, int ceng) { SPQuery query = n... 阅读全文
posted @ 2014-07-15 11:12 Toby Wang 阅读(274) 评论(0) 推荐(0)
摘要: .NET导出Excel遇到的80070005错误的解决方法: 检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046}的组件时失败,原因是出现以下错误: 80070005基本上.net导出excel文件,都需要如此配置一下,不配置有的时候没... 阅读全文
posted @ 2014-07-15 11:10 Toby Wang 阅读(526) 评论(0) 推荐(0)
摘要: public static void DataTabletoExcel(System.Data.DataTable tmpDataTable, string strFileName) { if (tmpDataTable == null ) ... 阅读全文
posted @ 2014-07-15 11:09 Toby Wang 阅读(323) 评论(0) 推荐(0)
摘要: int n = list.GetItemById(1).Versions.Count;//获取版本的数量 for (int i = n - 1; i >= 0; i--){ if (list.GetItemById(1).Versions[i]["Title"] != null) ... 阅读全文
posted @ 2014-07-15 11:07 Toby Wang 阅读(153) 评论(0) 推荐(0)
摘要: SPSecurity.RunWithElevatedPrivileges(delegate { using (var site = new SPSite(StrUrl)) { #r... 阅读全文
posted @ 2014-07-15 11:05 Toby Wang 阅读(257) 评论(0) 推荐(0)
摘要: using System;using Microsoft.SharePoint;using Microsoft.SharePoint.WebControls;using Microsoft.Office.Interop.Excel;using System.IO;using System.Refle... 阅读全文
posted @ 2014-07-15 11:03 Toby Wang 阅读(248) 评论(0) 推荐(0)
摘要: ////// 为DropDownList帮定数据//////需要绑定的控件///列表地址,如:Lists/Type/AllItems.aspx///web网站地址,如http://demo1/,为动态获取publicvoidSelectBindData(DropDownListselect,st... 阅读全文
posted @ 2014-07-15 10:58 Toby Wang 阅读(209) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-07-15 10:57 Toby Wang 阅读(1017) 评论(0) 推荐(0)
摘要: protected void OkButton_Click(object sender, EventArgs e) { if (fileUpload.HasFile) { string strLoginName = HttpContext.Current.User.Identity.Name.ToS... 阅读全文
posted @ 2014-07-15 10:11 Toby Wang 阅读(174) 评论(0) 推荐(0)
摘要: SPList typeList = web.Lists["类别" ]; foreach (SPListItem type in typeList.Items) { ... 阅读全文
posted @ 2014-07-15 10:08 Toby Wang 阅读(217) 评论(0) 推荐(0)
摘要: "$" 是在jquery里面定义的。在一次项目中遇见这个错误:“$ is not defined error”.找了半天,网上都说是$没有定义,或者是js没有引入,但是我确实导入了。后来看到一片文章,才发现是js引入的时候顺序错了,给Jquery放在了后面引入,但是我前面已经用到jquery了。如果... 阅读全文
posted @ 2014-07-15 10:06 Toby Wang 阅读(183) 评论(0) 推荐(0)
摘要: 1 2 3 4 5 6 7 提醒发送到手机 8 9 10 11 每天提醒... 阅读全文
posted @ 2014-07-15 10:04 Toby Wang 阅读(207) 评论(0) 推荐(0)
摘要: SPSecurity.RunWithElevatedPrivileges(delegate()) 阅读全文
posted @ 2014-07-15 10:03 Toby Wang 阅读(181) 评论(0) 推荐(0)
摘要: 1 SPSecurity.RunWithElevatedPrivileges(delegate () 2 { 3 SPWebCollection sPWebCollection =... 阅读全文
posted @ 2014-07-15 10:01 Toby Wang 阅读(156) 评论(0) 推荐(0)
摘要: SPFieldUserValueCollection userColl = new SPFieldUserValueCollection(); ArrayList list = Manager.ResolvedEntities; ... 阅读全文
posted @ 2014-07-15 09:59 Toby Wang 阅读(262) 评论(0) 推荐(0)
摘要: 1 private static string connString = "Server = 127.0.0.1; Database = demoDB; Integrated Security =SSPI" ;2 using (SqlConnection conn = new SqlConnecti... 阅读全文
posted @ 2014-07-15 09:56 Toby Wang 阅读(214) 评论(0) 推荐(0)
摘要: 前台获取 1 $.ajax({ 2 //url: "demo/data/taskTree.txt", 3 url: "GanttChart.aspx?taskList=1" , 4 cache: false, 5 ... 阅读全文
posted @ 2014-07-15 09:55 Toby Wang 阅读(422) 评论(0) 推荐(0)
摘要: 其实只是用到了添加时的一个方法,类似的,可以根据模板添加网站等。用于新建项目时单个项目构建网站。 1 //添加列表 2 //Guid newListId = web.Lists.Add("任务列表", "", ... 阅读全文
posted @ 2014-07-15 09:53 Toby Wang 阅读(241) 评论(0) 推荐(0)
摘要: 据说,有一个spList.Data什么的属性,可以直接绑定,可以试一试哦using (SPWeb spWeb = new SPSite(Weburl).OpenWeb()) { var dt = new DataTable(); ... 阅读全文
posted @ 2014-07-15 09:47 Toby Wang 阅读(236) 评论(0) 推荐(0)