摘要: 1.string strTime = DateTime.Now.ToLongTimeString();2. DateTime dt = DateTime.Now; String str = dt.ToString("yyyy-MM-dd");或者 string str = DateTime.Now.ToString("yyyy-MM-dd"); 或者string str = DateTime.Now.ToShortDateString();3.DateTime.Now.ToString("yyyy-MM-dd");取日期,得到如200 阅读全文
posted @ 2013-02-06 15:48 乡土的味道 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 时间验证(仅年月日):Regex.IsMatch(birthday, @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[35 阅读全文
posted @ 2013-02-06 15:42 乡土的味道 阅读(538) 评论(0) 推荐(0) 编辑
摘要: dt.rows[0]["列名称"].Tosring();dt.rows[0][0].Tosring(); 表示第一行第一列的数据DataTable.Columns.Count 获取datatable的列数DataTable.Rows.Count 获取datatable的行数 阅读全文
posted @ 2013-02-06 15:39 乡土的味道 阅读(884) 评论(0) 推荐(0) 编辑
摘要: /// /// 添加XML /// /// private XmlDocument Add(string XFInterfaceCode, string DataSetCode, String TableDataCode, string item) { XmlDocument xd = new XmlDocument(); //创建根节点 XmlNode root = xd.DocumentElement; //创建元素 ... 阅读全文
posted @ 2013-02-06 15:35 乡土的味道 阅读(150) 评论(0) 推荐(0) 编辑
摘要: stringBuilder,完全可以替代string,最主要的是它的效率高//必须先实例化一个stringBuilder sBuilder = new stringBuilder();//您可以拼接执行SQL语句,易于阅读sBuilder.Append("select * from tb1");sBuilder.Append("where id=1");上面同等于strng sBuilder = "select * from tb1 where id=1"; 阅读全文
posted @ 2013-02-04 11:12 乡土的味道 阅读(164) 评论(0) 推荐(0) 编辑
摘要: <p align="left" style="height:60px;line-height:30px;margin:0;overflow-y:auto; overflow-x:hidden"> </p> 阅读全文
posted @ 2013-02-04 11:08 乡土的味道 阅读(1183) 评论(0) 推荐(0) 编辑
摘要: public int AddProduct(string ProductCode, string ProductName, decimal CurrentPrice, decimal OriginalPrice, string PackingUnit, string Specification, string PromotionalPrice, int CompanyID, string PromotionalStart, string PromotionalEnd) { string strSql = "INSERT INTO tblProduct... 阅读全文
posted @ 2013-02-04 11:07 乡土的味道 阅读(234) 评论(0) 推荐(0) 编辑
摘要: HTML前台模版: <asp:Repeater ID="lstProduct" runat="server"> <HeaderTemplate> <table class="lstTable"> <tr class="FormHeader" style="font-weight: bold;"> <td> 产品货号 </td> ... 阅读全文
posted @ 2013-02-04 11:03 乡土的味道 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 页面刷新前先提示后跳转Response.Write("<script>alter('提交成功!')</script>");Response.Write("<script>window.location.href='MaintainSupplierCompany.aspx'</script>");在Load事件里写:(就可以在单击btnClean按钮时跳出提示,单击确定执行Click事件下的操作,取消则不执行!)btnClean.Attributes.Add("onc 阅读全文
posted @ 2013-02-04 10:56 乡土的味道 阅读(912) 评论(0) 推荐(0) 编辑
摘要: JQuery.js/*! jQuery v1.8.3 jquery.com | jquery.org/license */(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typ 阅读全文
posted @ 2013-02-04 10:38 乡土的味道 阅读(500) 评论(0) 推荐(0) 编辑