2012年5月11日

摘要: declare @EcountrydbID int,@Keyword varchar(200),@EproductId int ,@PicPath varchar(300),@OldCountryDBID int,@OldCountryChoosedProductsIds varchar(1000);set @OldCountryChoosedProductsIds='';set @EproductId=0;set @OldCountryDBID=0;declare mycursor cursor for--香港--select * from (select top 6 Eco 阅读全文
posted @ 2012-05-11 17:29 BlueAmbition 阅读(222) 评论(0) 推荐(0) 编辑

2012年5月9日

摘要: select *,1 Sort from Tab1 where XXunionselect *,2 Sort from epic where XX and XX(排除上面SQL查询的数据) order by Sort asc,Epic_ID asc。缺陷:union失去排除重复的左右。适用场合:上面查询语句数据必须排在后面查询语句数据前面并且上面数据较少。否则另取他法。 阅读全文
posted @ 2012-05-09 15:39 BlueAmbition 阅读(1055) 评论(0) 推荐(0) 编辑

2012年5月4日

摘要: protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { int index = e.Item.ItemIndex; }<asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> 行号:<%#Container.ItemIndex %> </ItemTemplate></asp:Repeater> 阅读全文
posted @ 2012-05-04 16:09 BlueAmbition 阅读(5793) 评论(0) 推荐(0) 编辑

2012年5月3日

摘要: Sql时间函数一、sqlserver日期时间函数SqlServer中的日期与时间函数1.当前系统日期、时间selectgetdate()2.dateadd在向指定日期加上一段时间的基础上,返回新的datetime值例如:向日期加上2天selectdateadd(day,2,'2004-10-15')--返回:2004-10-1700:00:00.0003.datediff返回跨两个指定日期的日期和时间边界数。selectdatediff(day,'2004-09-01','2004-09-18')--返回:174.datepart返回代表指定日期 阅读全文
posted @ 2012-05-03 11:44 BlueAmbition 阅读(189) 评论(0) 推荐(0) 编辑

2012年5月2日

摘要: 当使用UNION ALL或者UNION时,如果按照NewId()随机排序,那么,不能直接写SQL 代码SELECT TOP 2 * FROM [Article] Where ArticleId < 100 Order By NewId()UNION ALLSELECT TOP 8 * FROM [Article] Where ArticleId > 200 Order By NewId()需要写成SQL 代码SELECT * FROM (SELECT TOP 2 * FROM [Article] Where ArticleId < 100 Order By NewId()) 阅读全文
posted @ 2012-05-02 17:14 BlueAmbition 阅读(330) 评论(0) 推荐(0) 编辑

2012年4月25日

摘要: <html> <head> <script type="text/javascript"> var t1=document.getElementById("txt1"); function isFocus(){ if(document.activeElement.id=='txt2'){ alert('txt2获得焦点'); } else{ alert('txt2未获得焦点'); } } ... 阅读全文
posted @ 2012-04-25 15:48 BlueAmbition 阅读(8569) 评论(0) 推荐(0) 编辑
 
摘要: <script language='javascript'> document.onkeydown=function(){ if (event.keyCode == 13){ alert('回车键.'); } else{ alert('你按错了键.'); } }</script> 阅读全文
posted @ 2012-04-25 15:44 BlueAmbition 阅读(20558) 评论(0) 推荐(0) 编辑

2012年4月24日

摘要: select count(1) as pCount,列1,列2,列3 from Tempinner join temp1 on 条件1=条件1group by 列1,列2,列3 order by pCount desc 阅读全文
posted @ 2012-04-24 17:23 BlueAmbition 阅读(779) 评论(0) 推荐(0) 编辑

2012年4月19日

摘要: return在方法中至终止当前方法的执行,方法外后面的代码继续执行,有时小粗心就忘记这个。 阅读全文
posted @ 2012-04-19 10:16 BlueAmbition 阅读(458) 评论(0) 推荐(0) 编辑
 
摘要: 文件下载,指定默认名srxljlResponse.AddHeader("content-type","application/x-msdownload");Response.AddHeader("Content-Disposition","attachment;filename=要下载的文件名.rar");刷新页面srxljlResponse.AddHeader “REFRESH”, ”60;URL=newpath/newpage.asp” 这等同于客户机端<META>元素: <META HTTP 阅读全文
posted @ 2012-04-19 10:14 BlueAmbition 阅读(208) 评论(0) 推荐(0) 编辑