asp.net中Execl文件的导入导出

/// /// 从Excel中导出数据到DataSet中 /// /// Excel文件的绝对路径 /// excel文件中的表名 /// public DataSet ExcelDataSource(string filepath, string sheetname) { string strConn; …… 阅读全文

Repeater嵌套绑定Repeater

private void RpTypeBind() { //GetQuestionTypeAndCount() 返回一个datatable this.rptypelist.DataSource = LiftQuestionCtr.GetQuestionTypeAndCount(); this.rptypelist.DataBind() …… 阅读全文

比较完善的asp.net2.0邮件发送类

using System;using System.Net.Mail;using System.IO;/// /// Utilities 的摘要说明/// public static class Utilities{ static Utilities() { // // TODO: 在此处添加构造函数逻辑 …… 阅读全文

C#图片上传,加水印,自动生成缩略图类

using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web …… 阅读全文

C#中 TrimEnd()用法

①去除最后的逗号 string str=ab,cd,ef,;str=str.TrimEnd(new char[] { ',' });返回结果则是:ab,cd,ef②去掉日期格式的00:00:00char [] strRemove={'0',':'}; lblBirthday.Text = myReader ["Birthday"].ToString().Tr …… 阅读全文

C#连接各种数据库语句(实例)

//Accessusing System.Data;using System.Data.OleDb;connString ="Provider =Microsoft.Jet.OleDb.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data/MyDataBase.mdb"); …… 阅读全文