摘要:publicstaticboolExportExcelWithAspose(System.Data.DataTabledt,stringpath)2{3boolsucceed=false;4if(dt!=null)5{6try7{8Aspose.Cells.Licenseli=newAspose.Cells.License();9stringlic=Resources.License;10Streams=newMemoryStream(ASCIIEncoding.Default.GetBytes(lic));11li.SetLicense(s);1213Aspose.Cells.Workb..
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.IO;using System.Data;using Aspose.Cells;/// <summary>///OutFileDao 的摘要说明/// </summary>publicclass OutFileDao{public OutFileDao(){////TODO: 在此处添加构造函数逻辑//}/// <summary>/// 测试程序/// </summa
阅读全文
摘要:/// <summary> /// 导出excel /// </summary> /// <param name="dt">datatable</param> /// <param name="FileName">excel名称</param> /// <param name="page">this.Page</param> public void ToExcel(DataTable dt, string FileName,System.W
阅读全文
摘要:SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());protected void addTree(int ParentID, TreeNode pNode){//打开数据库sqlconn.Open();//把数据添加到数据表中SqlDataAdapter da = new SqlDataAdapter("select * from Departments", sqlconn);sql
阅读全文
摘要://将datatable转换为jsonpublic string DtToJson(DataTable dt){StringBuilder jsonBuilder = new StringBuilder();jsonBuilder.Append("[");for (int i = 0; i < dt.Rows.Count; i++){jsonBuilder.Append("{");for (int j = 0; j < dt.Columns.Count; j++){jsonBuilder.Append("\"")
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TreeView1.ShowLines = true; TreeView1.ExpandDepth = 1; TreeView1.Nodes.Clear(); addTree("省总部", (TreeNode)null); }}protected void addTree(string ParentID, TreeNode pNode) { DataTable dt = new HRService.UserInfo().getP
阅读全文