摘要: execmaster..xp_cmdshell'bcp"select*from[BookShop].[dbo].[tb_Books]where[UnitPrice]=22"queryoutd:temp.xls-c-q-S"."-U"sa"-P""' 阅读全文
posted @ 2012-06-05 00:04 hishanghai 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1. 当前系统日期、时间select getdate()2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值例如:向日期加上2天select dateadd(day,2,'2004-10-15') --返回:2004-10-17 00:00:00.0003. datediff 返回跨两个指定日期的日期和时间边界数。select datediff(day,'2004-09-01','2004-09-18') --返回:174. datepart 返回代表指定日期的指定日期部分的整数。SELECT DATEPART( 阅读全文
posted @ 2012-06-04 18:14 hishanghai 阅读(218) 评论(0) 推荐(0) 编辑
摘要: -- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:修改新闻-- =============================================ALTER PROCEDURE [dbo].[news_UpdateByID] @newsName varchar(100), @classID int, @newsContent text, @newsID intASBEGINupd 阅读全文
posted @ 2012-06-03 23:31 hishanghai 阅读(114) 评论(0) 推荐(0) 编辑
摘要: selectage,count(*),max(age)as最大年龄fromperson1groupbyAgehavingAge>20selecttop3*fromperson1--筛选出年龄不在top3中的数据,也就是第四、五selecttop2*fromperson1whereagenotin(selecttop3agefromperson1orderbyagedesc)orderbyage--去掉数据重复selectDepartment,count(*)fromperson1groupbyDepartmentselectdistinctDepartment,Agefromperson 阅读全文
posted @ 2012-06-03 23:13 hishanghai 阅读(326) 评论(0) 推荐(0) 编辑
摘要: ALTER TRIGGER [dbo].[trigCateDelete] ON [dbo].[category] instead of DELETEAS BEGIN declare @caId int select @caId=(select id from deleted) delete comment where newsId in (select newsId from news where caId=@caId) delete news where caId=@caId delete category where id=@caIdENDALTER procedure [dbo].[p. 阅读全文
posted @ 2012-06-03 23:12 hishanghai 阅读(80) 评论(0) 推荐(0) 编辑
摘要: WindowprotectedvoidMess(stringMes){this.ClientScript.RegisterStartupScript(GetType(),"a","alert('"+Mes+"');",true);}VS向SQL中寫入DateTime:SqlParameter[]sqlParaInsert=newSqlParameter[]{newSqlParameter("@empNo",txt_Employee_No.Text.Trim()),newSqlParameter(&q 阅读全文
posted @ 2012-05-31 09:39 hishanghai 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Google:http://community.arubanetworks.com/t5/ArubaOS-and-Controllers/MAC-Address-Authentication-Server-Group/td-p/8808/page/2http://www.google.com.hk/#q=aruba+guest+mac+address&hl=zh-CN&newwindow=1&safe=strict&prmd=imvns&ei=rk3DT7vDKKjeigeBwK2wCg&start=10&sa=N&fp=1&am 阅读全文
posted @ 2012-05-28 20:42 hishanghai 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 验证码类:usingSystem.Drawing;publicpartialclassvalidateNum:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){stringvalidateNum=CreateRandomNum(4);//成生位随机字符串CreateImage(validateNum);//将生成的随机字符串绘成图片Session["ValidateNum"]=validateNum;//保存验证码}}//生成随机字符串privatestrin 阅读全文
posted @ 2012-05-28 00:26 hishanghai 阅读(224) 评论(0) 推荐(0) 编辑
摘要: SQLHelper类执行对数据库的访问,并返回值:连接DB的方法以及SqlCommand的各种方法的重写(传入参数,参数类型,返回的值)等。App_Code文件夹存放网站中通用的类,App_Data文件夹存放一些数据文件XML文件等,WebConfig文件中存放全局的参数。缓存可以提高对DB的访问效率,.CS文件更改后需要编译重新生成。try,catch中可以把错误日志写到Log中。usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Sec 阅读全文
posted @ 2012-05-27 23:22 hishanghai 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 用到HTML中的Input(File)控件,命名空间 using System.IO;//Path,获得文件名时用到的命名空间属性&方法:PostedFile要上传的文件对象,Path.GetFileName得到文件名,Server.MapPath转化路径,PostedFile.SaveAs文件保存 protected void Button1_Click(object sender, EventArgs e) { string fileName = Path.GetFileName(File1.PostedFile.FileName);//得到要上传的文件名称 fileName = 阅读全文
posted @ 2012-05-27 17:34 hishanghai 阅读(933) 评论(0) 推荐(0) 编辑