易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net 实现excel导入到数据库

//Excel批量导入到数据库
      protected void btnUpload_Click(object sender, EventArgs e)
      {   
         string IsXls = System.IO.Path.GetExtension(UploadExcel.FileName.ToString().ToLower());
         if (IsXls != ".xls")
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script type='text/javascript' language='javascript'>alert('只可以选择Excel文件');location.href='EmployeeAddPage.aspx';</script>");
               return;//当选择的不是Excel文件时,返回
         }
          string filePath = UploadExcel.PostedFile.FileName;
          string fileName = UploadExcel.FileName;
          DataSet ds = ExecleDs (filePath,fileName);
          CommonLayer.employeeModel model = new CommonLayer.employeeModel();
          DataAcessLayer.employee_infomation addlist = new DataAcessLayer.employee_infomation();
          if (ds.Tables[0].Rows.Count > 0)
          {
              int row = ds.Tables[0].Rows.Count-1;
              for (int i = 0; i < ds.Tables[0].Select().Length; i++)
              {
          &


相关文档:

ASP.NET与MySql的连接

1.数据连接方式
ASP.NET本身的数据访问ADO.NET不支持对于MySql的连接和查询,但是MySQL官网上均提供了多种ASP.NET连接到MySQL的方式:
(1)ODBC驱动的访问方式:mysql-connector-odbc-5.1.5-win32.msi,ODBC
(2)ADO.NET对于MySQL的访问方式:mysql-connector-net-6.2.2.zip
个人选用的是第二种,感觉方便,和.NET对S ......

文档中提示 页面会变白 asp.net简单加密

Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('加入暂存架成功!');</script>"); 
asp.net简单加密
//using System.Web.Security;
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfig ......

ASP.NET遍历控件的几种方法

方法一:javascript法 function btnClear() { for(i=0;i /// 清空指定页面上所有的控件内容,包括TextBox,CheckBox,CheckBoxList,RadioButton,RadioButtonList。但是不清 /// 除如ListBox,DropDownList,因为这样的控件值对当前页面来说还可以用,一般这些控件里都是保存的字典数据。 /// Author:Kevin /// 日期:2004-12 ......

asp.net 图片水印

string mapho = request["imgpath"];//获取某个页面传过的图片名称
  string str1 = Server.MapPath(mapho);//要添加水印的图片
  string str2 = Server.MapPath("WaterMark.jpg");//添加的内容图片
  System.Drawing.Image bmp = System.Drawing.Image.fromFile(str1);
  Graphics gs = Graphics. ......

ASP.NET2005 设置GridView表头的背景图片


最近在做一个网站,显示数据时为了方便使用了GridView。虽然GridView显示数据的功能很强也很方便,但它的样式却并不美观。为了使GridView的显示样式美观一些,经常需要设置表头的背景,我总结出的方法如下:
方法一:
在GridView的OnRowDataBound事件中设置背景,代码如下:
protected void GridView1_RowDataBound(ob ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号