随笔分类 -  经验总结

sql经验
摘要:1.Create Table TableXml(id int identity(1,1) Primary Key,x xml)GoInsert Into TableXml Select '<root> <Info id="1" name="Name1" City="City1"/> <Info id="2" name="Name2" City="City2"/> <Info id="3" name=&quo 阅读全文

posted @ 2010-10-19 23:50 jianshaohui 阅读(190) 评论(0) 推荐(0)

bytes 与 string 互转,stream to Byte[]
摘要:Using System.Text;byte[ ] 转换为stringbyte[ ] image;string ll = Encoding.Default.GetString(image);string 转换为byte[ ]string ss;byte[] b = Encoding.Default.GetBytes(ss);数据库中image类型的字段的处理。首先我想从数据库中读出图片(以image类型存储的), 并且写入txt文件中:private void GetImage() { string conn = "Server=192.168.0.11; User id=user; Pwd= 阅读全文

posted @ 2010-09-30 16:05 jianshaohui 阅读(3411) 评论(0) 推荐(0)

ASP.NET以及JS获取URL和IP地址
摘要:ASP.NET以及JS获取URL和IP地址HttpContext.Current.Request.Url.ToString() 并不可靠。如果当前URL为http://localhost/search.aspx?user=http://csharp.xdowns.com&tag=%BC%BC%CA%F5通过HttpContext.Current.Request.Url.ToString()... 阅读全文

posted @ 2010-09-25 09:50 jianshaohui 阅读(780) 评论(0) 推荐(0)

文件下载
摘要:string fileName = ""; string filePath = Server.MapPath("");//路径 FileInfo fileInfo = new FileInfo(filePath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Cont... 阅读全文

posted @ 2010-09-14 13:10 jianshaohui 阅读(282) 评论(1) 推荐(0)

jsonp
摘要:$(function() {$.ajax({url: "http://****.***.com/***.html?callback=?",dataType: "jsonp",jsonp: 'callback'});}); public ContentResult ***() { int state = 0; if (HttpContext.User.Identity.IsAuthenticate... 阅读全文

posted @ 2010-08-09 14:22 jianshaohui 阅读(193) 评论(0) 推荐(0)

处理一对多的关系,比如一个订单 里面 有n 个商品
摘要:set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoalter PROCEDURE [dbo].[sp_OrderPagination](@fields varchar(1000) = '*', -- 需要返回的列 @sortField varchar(255)='', -- 排序的字段名, max(字段)或min(字段)字段不重复@pageSize int = ... 阅读全文

posted @ 2010-07-29 12:05 jianshaohui 阅读(670) 评论(0) 推荐(0)

SQL Server 2005四个新的排序函数: ROW_NUMBER、RANK、DENSE_RANK 和 NTILE
摘要:ROW_NUMBER、RANK、DENSE_RANK 和 NTILE,这些新函数使您可以有效地分析数据以及向查询的结果行提供排序值。您可能发现这些新函数有用的典型方案包括:将连续整数分配给结果行,以便进行表示、分页、计分和绘制直方图。 Speaker Statistics 方案下面的 Speaker Statistics 方案将用来讨论和演示不同的函数和它们的子句。大型计算会议包括三个议题:数据库... 阅读全文

posted @ 2010-07-29 12:03 jianshaohui 阅读(307) 评论(0) 推荐(0)

检查临时表是否存在
摘要:sql server检查临时表是否存在使用中发现 select into 临时表 很麻烦,下面是使用中发现的一些注意事项(一下以mssqlserver为例):1,一般使用create table person (id int ,name varchar(20),birthday datetime) 读取数据到临时表中 select * into #tb_tmp from person where ... 阅读全文

posted @ 2010-07-29 12:02 jianshaohui 阅读(967) 评论(0) 推荐(0)

.net技术注意
摘要:1.fckeditor 脚本出现unterminated string literal问题的时候,一般就是遇到付给value值有换行情况。 一般对此处理要使用替换方式:return content.Replace("'", "&#39").Replace("'", "&#34").Replace("\r","\\");或者直接在控件里赋值注意:单引号,双引号,换行符号。换行不是转换\n,而是转换\r2.回转 url ReturnUrl=< 阅读全文

posted @ 2010-07-26 14:57 jianshaohui 阅读(447) 评论(1) 推荐(0)

sql 常用函数
摘要:ISNUMERIC(字段)isnull(字段)cast(字段 as 类型)convert(类型,字段)rownumber() over(order a desc) 阅读全文

posted @ 2010-07-22 14:19 jianshaohui 阅读(121) 评论(0) 推荐(0)

flash挡住图片
摘要:1、加入 <param name="wmode" value="transparent" />2、加入 <embed src="YourFlash.swf" wmode="transparent" ... ></embed>参考http://www.artery.cn/news/WEBbiaozhunhua/2009-06-14/197.html源代码 阅读全文

posted @ 2010-07-19 23:11 jianshaohui 阅读(336) 评论(0) 推荐(0)

常用js
摘要:1.常用函数function(evt) { var e = (evt) ? evt : window.event; if (window.event) { e.cancelBubble = true; } else { e.stopPropagation(); }阻止事件function(ele, e, call) { if (window.addEventListener) ele.addEventListener(e, call, false); else ele.attachEvent("on" + e, call); }添加事件$("#addClassName").keydown(fu 阅读全文

posted @ 2010-06-30 16:55 jianshaohui 阅读(219) 评论(1) 推荐(0)

过滤sql特殊字符方法集合
摘要:1./// <summary> /// 过滤不安全的字符串 /// </summary> /// <param name="Str"></param> /// <returns></returns> public static string FilteSQLStr(string Str) { Str = Str.Replace... 阅读全文

posted @ 2010-06-29 11:54 jianshaohui 阅读(6030) 评论(0) 推荐(0)

js ui
摘要:http://www.planeart.cn/downs/artDialog/ 不依赖其他库http://www.javaeye.com/topic/541141 主题:基于jquery和mini_magick的图片裁剪 http://odyniec.net/projects/imgareaselect/examples-advanced.htmlhttp://www.google.com.hk/... 阅读全文

posted @ 2010-06-10 10:36 jianshaohui 阅读(272) 评论(0) 推荐(0)

导航