随笔分类 - C#
摘要:public static class ChineseToPinYin { private static readonly Dictionary<<span class="keyword">int, string> CodeCollections = newDictionary<<span clas
阅读全文
摘要:18 public static void SaveError(Exception ex,HttpContext hc,HttpRequest hr)19 {20 string temp ;21 StreamWriter sw ;2223 //如果存在文件24 if(File.Exists(hr.P
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Syste
阅读全文
摘要:// /// 类型转换类 /// 处理数据库获取字段为空的情况 /// public static class DBConvert { #region ToInt32类型转换 /// /// 读取数据库中字符串并转换成Int32 /// 为空时返回0 /// /// object类型的值 /// I
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO;namespace 读写ini文件 { public class Ini { // 声明I...
阅读全文
摘要:在开发会遇到将gridview中的数据导入到excel 这样的需求,当girdview有多页数据时按照一般的方式导出的数据只可能是当前页的数据,后几页的数据还在数据库内,没有呈现到页面上,传统的方式是将标记字符和文本写入到 ASP.NET 服务器控件输出流,没有呈现的页面不可能输出到excel中。下面提供一种解决方式将所以数据都能导入到excel中。第一步:记录查询条件,当用户点击下载的时候以相同的条件查询,呈现到datatable这一步没有固定的代码,可以在用户查询的时候用ViewState记录查询条件,例如OrderMng.OrderList_GetSupOrderList_BindDat
阅读全文
摘要:asp.net教程:GridView导出到Excel或Word文件在项目中我们经常会遇到要求将一些数据导出成Excel或者Word表格的情况,比如中国移动(我是中国移动用户)网上查话费的页面中就有一个导出到Excel的功能,光大网上银行查看历史明细也有这些功能....,原本以为这个问题不难的,不过看到网上经常有朋友问,于是我整理了一下,供大家参考。 前台页面: GridView导出到Excel或Word文件——周公的博客:http://blog.csdn.net ...
阅读全文
摘要:DataList 提供相关的编辑模板,但和DataGrid不一样的是,DataList没有编辑按钮。要在DataList中使用编辑功能,可在项模板中增加一个按 钮,Linkbutton和Button都可以。在CommandName中设置为Edit就可以把此按钮和DataList的编辑事件联系起来了。如:编辑按钮可以使用CommandName="Edit"更新按钮可以使用CommandName="Update"取消按钮可以使用CommandName="Cancel"删除按钮可以使用CommandName="Delete&quo
阅读全文

浙公网安备 33010602011771号