摘要: 例如:id name value1 a pp2 a pp3 b iii4 b pp5 b pp6 c pp7 c pp8 c iiiid是主键要求得到这样的结果id name value1 a pp3 b iii4 b pp6 c pp8 c iii方法1delete YourTable where [id] not in ( select max([id]) from YourTable group by (name + value)) 方法2delete a from 表 a left join( select ... 阅读全文
posted @ 2012-08-24 11:31 zyswtwang 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 一、这是一个绘制圆角窗体的静态类:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Forms;using System.Drawing;using System.Drawing.Drawing2D;namespace WindowsFormsApplication2{ public static class RoundFormDraw { public static void Paint(this object ... 阅读全文
posted @ 2012-08-02 15:13 zyswtwang 阅读(1029) 评论(0) 推荐(0) 编辑
摘要: 查找所有重复标题的记录:SELECT *FROM t_info aWHERE ((SELECT COUNT(*)FROM t_infoWHERE Title = a.Title) > 1)ORDER BY Title DESC一。查找重复记录1。查找全部重复记录Select * From 表 Where 重复字段 In (Select 重复字段 From 表 Group By 重复字段 Having Count(*)>1)2。过滤重复记录(只显示一条)Select * From HZT Where ID In (Select Max(ID) From HZT Group By Ti 阅读全文
posted @ 2012-08-01 10:55 zyswtwang 阅读(207) 评论(0) 推荐(0) 编辑
摘要: private void txtPort_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != '\b')//允许输入退格键 { if ((e.KeyChar < '0') || (e.KeyChar > '9'))//允许输入0-9数字 { e.Handled = true; } } ... 阅读全文
posted @ 2012-07-04 20:31 zyswtwang 阅读(360) 评论(0) 推荐(0) 编辑
摘要: NetworkInterface[] NetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface NetworkIntf in NetworkInterfaces) { IPInterfaceProperties IPInterfaceProperties = NetworkIntf.GetIPProperties(); UnicastIPAddressInformatio... 阅读全文
posted @ 2012-07-04 16:30 zyswtwang 阅读(6511) 评论(0) 推荐(2) 编辑
摘要: ISNUMERIC确定表达式是否为一个有效的数字类型。语法ISNUMERIC ( expression )参数expression要计算的表达式。返回类型int注释当输入表达式得数为一个有效的整数、浮点数、money 或 decimal 类型,那么 ISNUMERIC 返回 1;否则返回 0。返回值为 1 确保可以将 expression 转换为上述数字类型中的一种。 阅读全文
posted @ 2012-06-27 11:44 zyswtwang 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Response.ContentType = "application/octet-stream"; //通知浏览器下载文件而不是打开 Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(model.Zlbt+"."+model.Zlhz, System.Text.Encoding.UTF8)); Response.BinaryWr... 阅读全文
posted @ 2012-06-15 10:42 zyswtwang 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 1.最小权限原则。“只允许用户做XXXX”而不是“不允许用户做XXXX”2.能在浏览器端完成的事情,就不要到服务端去做3.客户端是不可信的。 阅读全文
posted @ 2012-05-25 10:11 zyswtwang 阅读(191) 评论(0) 推荐(0) 编辑
摘要: //获取QueryString的数组function getQueryString(){ var result = location.search.match(new RegExp("[\?\&][^\?\&]+=[^\?\&]+","g")); if(result == null){ return ""; } for(var i = 0; i < result.length; i++){ result[i] = result[i].substring(1); } return result;}//根据Q 阅读全文
posted @ 2012-04-18 16:30 zyswtwang 阅读(3483) 评论(0) 推荐(0) 编辑
摘要: CSS主要有元素内联、页面嵌入、外部引用三种方式元素内联:直接将样式写入元素的style属性中,例如:<input type="text" style="background-color".#FF00FF* />,适用于样式没有可复合型的场所。页面嵌入:在head中加入<style type="text/css"> input{border-color:Yello,color.Red}</style>表示页面中所有input都是采用指定的样式。适用于样式的服用,减少页面体积外部引用:将CSS内容写入 阅读全文
posted @ 2011-12-26 03:41 zyswtwang 阅读(139) 评论(0) 推荐(0) 编辑