读取Execl数据到Datatable或DataSet时 日期单元格出现乱码的解决方案
//Execl某单元格数据为 2012-1-10 读取到DataTable变为40918 不是正确的2012-1-10 //解决方法一: //strValue是你的日期40918 值带进来 public static string getDateStr(string strValue) { int i = Convert.ToInt32(s …… 阅读全文
//Execl某单元格数据为 2012-1-10 读取到DataTable变为40918 不是正确的2012-1-10 //解决方法一: //strValue是你的日期40918 值带进来 public static string getDateStr(string strValue) { int i = Convert.ToInt32(s …… 阅读全文
public static string ExportTable(DataSet ds) { StringBuilder sb = new StringBuilder(); int count = 0; foreach (DataTable tb in ds.Tables) { sb.A …… 阅读全文
private void Page_Load(object sender, System.EventArgs e) { beginProgress(); for (int i = 1; i <= 100; i++) { setProgress(i); //此处用线程休眠代替实际的操作,如加载数据 …… 阅读全文
using System;using System.Collections.Generic;using System.Text;using System.Data.SQLite; //引用using System.Data;using System.Data.Common;namespace MSCL{ /// /// 本类为SQLite数据库帮助类 …… 阅读全文
<asp:GridView ID="GridView1" runat="server" ClientIDMode="Static" AutoGenerateColumns="True" CssClass="gvCss" onrowcreated="GridView1_RowCreated"> protected void GridView1_RowCreated …… 阅读全文
/// /// 将DT转换为Execl的方法 /// /// 需要导出的DT /// 页面 /// 文件名 public void ToExecl(DataTable dt, Page page, string fileName) { HttpResponse response = page.Respons …… 阅读全文
// 计算数据,完全可以从数据看取得 ICollection CreateDataSource( ) { System.Data.DataTable dt = new System.Data.DataTable(); System.Data.DataRow dr; dt.Columns.Add(new System.Data.DataColumn("学生班级", t …… 阅读全文
可同时操作多个不同类型的数据库。 完全不用考虑数据类型的差别,再也不用想字符型字段加不加单引号。 调用非常简单,对数据库的主要操作一般只需要一行代码。 支持mssql事务回滚。 可自动生成和输出sql语句方便调试。 使用方法: 1. 修改clsDbctrl.asp文件中的第1行为你自己的数据库位置(修改方法参考下面的CreatConn函数说明)。如需连接多个数据库可自行 …… 阅读全文