Frankwangyifang

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2009年11月10日

摘要: DAL层:try{da.Fill(ds); // 填充DataSet }catch(Exception ex){throw new Exception(ex.Message); //文件不存在或补占用等异常! }UI层:try{dt = ole.Import(xlsfile);} catch (Exception ex) //这里抛出的是DAL中的异常信息.注意: ex.Mesage 里面可能有... 阅读全文
posted @ 2009-11-10 13:16 Frankwangyifang 阅读(332) 评论(0) 推荐(0) 编辑

摘要: 1, 文件是否存在.2, 文件后缀名是否正确.3,路径不能为空. 阅读全文
posted @ 2009-11-10 13:15 Frankwangyifang 阅读(208) 评论(0) 推荐(0) 编辑

摘要: 1, 方法最好有个返回值(bool/int/string ) 因为,你不知道会出现什么错误,这样就可以根据返回值来判断方法是否执行成功. 2,方法里面不要写提示信息(如: Response.Write("Success!");, Page.ClientScript.RgeisterStartup(this.gettype(),"","alert('Success!')",true);等).只要返回... 阅读全文
posted @ 2009-11-10 13:14 Frankwangyifang 阅读(184) 评论(0) 推荐(0) 编辑

摘要: 商务快车: 批量注册软件! 但是注册码要手写! 阅读全文
posted @ 2009-11-10 13:13 Frankwangyifang 阅读(163) 评论(0) 推荐(0) 编辑

摘要: 1. 数据库访问性能优化   数据库的连接和关闭   访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源。ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭时收回连接,等待下一次的连接请求。   连接池的大小是有限的,如果在连接池... 阅读全文
posted @ 2009-11-10 13:12 Frankwangyifang 阅读(212) 评论(0) 推荐(0) 编辑

摘要: 用户控件的属性要能够在属性窗口上显示,则要写特性!e: [CategoryAttribute("Marketting Settings"), DescriptionAttribute("If the customer has bought more than 10 times, this is set to true")]   public bool FrequentBuyer   {    ge... 阅读全文
posted @ 2009-11-10 13:08 Frankwangyifang 阅读(242) 评论(0) 推荐(0) 编辑

摘要: using System;using System.Web;using System.Web.UI.HtmlControls ;using System.Web.UI;public class JScript{public JScript(){ // // TODO: 在此处添加构造函数逻辑 //}public static void AlertAndRedirect(string message... 阅读全文
posted @ 2009-11-10 13:06 Frankwangyifang 阅读(325) 评论(0) 推荐(0) 编辑

摘要: using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebContr... 阅读全文
posted @ 2009-11-10 13:03 Frankwangyifang 阅读(239) 评论(0) 推荐(0) 编辑

摘要: if (this.TextBox1.Text.Trim() != ""){int len = int.Parse(this.TextBox1.Text.Trim());for (int i = 0; i < len; i++){TableCell tc = new TableCell();TableCell tc2 = new TableCell();TextBox txt = new Te... 阅读全文
posted @ 2009-11-10 13:00 Frankwangyifang 阅读(238) 评论(0) 推荐(0) 编辑

摘要: 1.//弹出对话框.点击转向指定页面 Response.Write(&quot; <script>window.alert('该会员没有提交申请,请重新提交!') </script>&quot;); Response.Write(&quot; <script>window.location ='http://www.51aspx.com/... 阅读全文
posted @ 2009-11-10 12:40 Frankwangyifang 阅读(168) 评论(0) 推荐(0) 编辑