2010年2月24日
摘要: Global.asax void Application_Error(object sender, EventArgs e) { //在出现未处理的错误时运行的代码 Exception objErr = Server.GetLastError().GetBaseException(); string error = "发生异常页: " + Request.Url.ToString() + ""; error += "<br/>异常信息: " + objErr.Message + ""; Server.C 阅读全文
posted @ 2010-02-24 17:34 Renn.Erann 阅读(446) 评论(0) 推荐(0) 编辑
  2010年2月20日
摘要: <!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb23 阅读全文
posted @ 2010-02-20 12:01 Renn.Erann 阅读(703) 评论(0) 推荐(0) 编辑
  2010年2月11日
摘要: CSS代码如下:img { /*-- 专门用于限定文章DIV下的图片 --*/ max-width: 680px; max-height: 700px; }*html img { /*兼容IE6*/ width: expression(this.width > 700 && this.width > this.height ? 680 : true); height: expression(this.height > 700 || this.height > this.width ? 700 : true); } 阅读全文
posted @ 2010-02-11 09:40 Renn.Erann 阅读(318) 评论(0) 推荐(0) 编辑
  2010年1月22日
摘要: //得分计算四舍五入SELECT ROUND((SUM(getfeng)/SUM(totalfeng))*100) as feng FROM answerdata WHERE uid='151' AND targetid IS NOT NULL 1.ceil () /ceiling() 向上取整 例: ceil(1.2) = 22.floor () 向下取整 例: floor(1.2) = 13.round() 四舍五入 例:round(1.4)=1 round(1.5)=2 阅读全文
posted @ 2010-01-22 12:26 Renn.Erann 阅读(2267) 评论(0) 推荐(0) 编辑
  2010年1月17日
摘要: SQL SERVER 和EXCEL的数据导入导出1、在SQL SERVER里查询Excel数据:-- ======================================================SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]下面是个查询的示例,它通过用于 Je 阅读全文
posted @ 2010-01-17 17:01 Renn.Erann 阅读(394) 评论(0) 推荐(0) 编辑
  2009年12月28日
摘要: 上效果图。有数据时正常显示无数据时,则显示“暂无数据”此效果不需在CS文件中书写代码,只需在前台repeater中的 <FooterTemplate>项中加入如下代码:<FooterTemplate><tr runat="server" visible='<%#bool.Parse((rptShowTPDATA.Items.Count==0).ToString())%>'><td colspan="5" style=" padding-left:10px" mce_ 阅读全文
posted @ 2009-12-28 17:38 Renn.Erann 阅读(1018) 评论(0) 推荐(0) 编辑
  2009年12月22日
摘要: 正确效果是:单击选中 再次单击取消正确的效果代码如下: //全部取消代码。兼容IE,FF,Chrome function checkAll() { var ck = document.getElementsByTagName("input"); //找到页面上所有input节点 for (var i = 0; i < ck.length; i++) { if (ck[i].type == "checkbox") { ck[i].checked = false; } } } function ckeckedOne(obj) { if (!obj.ch 阅读全文
posted @ 2009-12-22 14:37 Renn.Erann 阅读(408) 评论(0) 推荐(0) 编辑
  2009年12月17日
摘要: 不费话了,上效果图。(1到20之间的数)使用说明: 本例是将1至size之间的数顺序打乱返回。但数不重复。用在一些在线考试——随机题但题不重复功能中。代码:/// <summary> /// 得到指定种子内的数据 随机数函数 /// 2009.12.17 by iflash50 /// </summary> /// <param name="size">种子长度</param> /// <returns>返回指定长度大小的随机数组</returns> private int[] GetRandData( 阅读全文
posted @ 2009-12-17 10:37 Renn.Erann 阅读(250) 评论(0) 推荐(0) 编辑
  2009年12月15日
摘要: 话不多说,上图先。前台代码:<table cellpadding="0" cellspacing="1" width="100%"><asp:Repeater ID="rptClass" runat="server" onitemdatabound="rptClass_ItemDataBound"> <ItemTemplate> <tr style=" height:30px;" mce_style=" 阅读全文
posted @ 2009-12-15 10:57 Renn.Erann 阅读(334) 评论(0) 推荐(0) 编辑
  2009年12月10日
摘要: 在BBS中常会用到第几楼。如果用repeater绑定数据时,可以使用新增一列数据来解决这个问题。代码如下:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sql = ""; sql = "SELECT * FROM dtproblem order by rand()"; DataTable dt = DTEDb.GetDataTable(sql); //加入题数。为DataTable加入新列“NewNum”记录数目 dt.Columns.Ad 阅读全文
posted @ 2009-12-10 00:31 Renn.Erann 阅读(274) 评论(0) 推荐(0) 编辑