静心

我是小明
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年12月11日

摘要: 使用Attributes,用txtPassword.Attributes.Add("value",实体对象.Password); 阅读全文

posted @ 2013-12-11 10:03 俗人一个 阅读(258) 评论(0) 推荐(0) 编辑

2013年5月8日

摘要: 在设置dgv的一行visiable=false时,如果该dgv是绑定的,则会提示“winform与货币管理器关联的行不能设置为不可见”,这时设置语句需要这样写:dgv.BindingContext[dgv.DataSource].SuspendBinding();dgv.Rows[i].Visible=false;dgv.BindingContext[dgv.DataSource].ResumeBinding(); 阅读全文

posted @ 2013-05-08 20:35 俗人一个 阅读(210) 评论(0) 推荐(0) 编辑

2012年7月29日

摘要: public DataTable GetPagedTable(DataTable dt) { int PageSize = AspNetPager1.PageSize; int PageIndex = AspNetPager1.CurrentPageIndex; if (PageIndex == 0) return dt; DataTable newdt = dt.Copy(); newdt.Clear(); int rowbegin = (PageIndex - 1) * PageSize; int rowend = PageIndex * PageSize; if (rowbegin &g 阅读全文

posted @ 2012-07-29 09:30 俗人一个 阅读(211) 评论(0) 推荐(0) 编辑

2012年7月27日

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT表名=casewhena.colorder=1thend.nameelse''end,表说明=casewhena.colorder=1thenisnull(f.value,'')else''end,字段序号=a.colorder,字段名=a.name,标识=casewhenCOLUMNPROPERTY(a.id,a.name,' 阅读全文

posted @ 2012-07-27 19:27 俗人一个 阅读(184) 评论(0) 推荐(0) 编辑

2012年4月9日

摘要: 在asp.net中导出excel 中比较通行的做法是Response.ContentType = "application/vnd.ms-excel";然后直接向里面扔 html 的table但是有中文的时候 老出现乱码,有很多解决方案,但都不能通盘解决,我在蓝色小铺上发现这篇文章方法不错,借鉴就是在 输出html两头输出 Response.Write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset=utf-8\"> 阅读全文

posted @ 2012-04-09 08:57 俗人一个 阅读(261) 评论(0) 推荐(0) 编辑

2012年3月29日

摘要: 对于framework4.0,当保存复杂的文本编辑框时,会报错,这是只需要在webconfig里配置一下即可: <system.web> <httpRuntime requestValidationMode="2.0"/> <pages validateRequest="false"></pages> </system.web> 阅读全文

posted @ 2012-03-29 20:40 俗人一个 阅读(211) 评论(0) 推荐(0) 编辑

摘要: ASPxGridView的模糊查询默认情况下只能是从文本开头来过滤,如对于“宁波建筑业企业”,输入“宁波”可以查到该记录,但是输入“建筑业”就查不到,得输入“%建筑业”才行。然而这样对于用户来说并不方便。通过下面这种方式可以解决: protected void ASPxGridView_ProcessColumnAutoFilter(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewAutoFilterEventArgs e) { if (e.Value.ToString() != "") { e.Value = 阅读全文

posted @ 2012-03-29 20:33 俗人一个 阅读(1814) 评论(1) 推荐(0) 编辑

2012年3月26日

摘要: 做网站与搞安全一般都离不开权限分配,网站权限一般都直接设置站点所在的虚拟目录的,也就是在虚拟目录的安全里添加internet来宾账户,并分配除完全控制外的所有权限;如果是.NET,还必须给ASP.NET用户配置除完全控制以外的权限!一般情况下,这样就OK了,服务器上的一般网站都可以正常运行了!但现在我发现:C/WINDOWS/TEMP临时文件夹的权限分配对网站能否成功运行也有影响!但前几天遇到2个情况:一、ASP站点:做版聚网站,稻草给的源代码,我过来测试时候,怎么都连不上数据库;我以为数据库连接代码出错,于是一点一点的测试,结果怎么都不行,运行到最后,还是没发现错误!代码如下:<%db 阅读全文

posted @ 2012-03-26 16:34 俗人一个 阅读(761) 评论(0) 推荐(0) 编辑

2012年2月27日

摘要: 转载自:http://www.cnblogs.com/cfam/archive/2006/11/17/563441.htmlasp.net 对xml文件的读写,添加,修改,删除操作usingSystem;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Web;usingSystem.Web.SessionState;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web 阅读全文

posted @ 2012-02-27 18:44 俗人一个 阅读(189) 评论(0) 推荐(0) 编辑

2011年8月23日

摘要: EXEC sp_configure 'show advanced options', 1;GORECONFIGURE;GOEXEC sp_configure 'Ad Hoc Distributed Queries', 1;GORECONFIGURE;GOInsert into sql表名(addtime,title,title_color,author,source,detail,readcount,poster,imageurl) SELECT news_date,news_title,news_color,news_author,news_ahome,new 阅读全文

posted @ 2011-08-23 10:10 俗人一个 阅读(193) 评论(0) 推荐(0) 编辑