博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月2日

摘要: sqlserver(05)中一些函数的使用说明:一、时间函数:DateAdd([year、Quarter、month、day],number,date)功能说明:用于特定的时间范围内相加或相减参数说明:[year、Quarter、month、day]为操作的基准单位,年,季度,月份,日...number:操作数,正为加,负为减如:DataAdd(year,10,getdate()):返回当前时间的10年后的年份DataAdd(month,-2,getdate()):返回当前时间的2个月前的月份datename([year、Quarter、month、day],date)功能说明:获取特定时间的 阅读全文

posted @ 2011-07-02 15:49 moss_tan_jun 阅读(343) 评论(1) 推荐(0) 编辑

摘要: sql 关联更新可以根据一个表的字段的值 像关联查询一样 修改 一个表的字段值 和另一个表关联update 表一 set 表一.列名= 表二.列名 from 表一,表二 where 表一.ID = 表二.ID 阅读全文

posted @ 2011-07-02 15:47 moss_tan_jun 阅读(313) 评论(0) 推荐(0) 编辑

摘要: 分别创建增加、删除、更新的触发器(Trigger)来达到两张表之间数据同步的目的。1:数据同步增加:如有两张表——A表和B表,创建触发器使当A表插入数据后B表也同步插入数据。其中B表插入数据的字段需要同A表中的字段相对应。CREATETRIGGER触发器名称ONA表AFTERINSERTASBEGININSERTINTOB表(B表字段1,B表字段2,B表字段3)SELECTA表字段1,A表字段2,A表字段3FROMINSERTEDEND2.数据同步删除:如有两张表——A表和B表,创建触发器使当A表删除数据后B表也同步删除数据。其中B表与A表应有相应主键关联。CREATETRIGGER触发器名称 阅读全文

posted @ 2011-07-02 15:45 moss_tan_jun 阅读(1297) 评论(0) 推荐(0) 编辑

摘要: C#追加文件 StreamWriter sw = File.AppendText(Server.MapPath(".")+"\\myText.txt"); sw.WriteLine("追逐理想"); sw.WriteLine("kzlll"); sw.WriteLine(".NET笔记"); sw.Flush(); sw.Close(); ============================================================================C#拷 阅读全文

posted @ 2011-07-02 15:39 moss_tan_jun 阅读(702) 评论(0) 推荐(0) 编辑

摘要: 1、Response.Redirect(Request.Url.ToString());2、Response.Write("<script>window.location.href=document.URL;</script>"); 3、Response.AddHeader("Refresh","0"); 4、<meta http-equiv="refresh" content="600; url=fls.html"> 阅读全文

posted @ 2011-07-02 15:35 moss_tan_jun 阅读(314) 评论(0) 推荐(0) 编辑

摘要: 实现这个功能,你需要为GridView控件设置DataKeyNames属性和OnRowCreated事件。 View Code <asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="false"DataKeyNames="MediaTypeId"OnRowCreated="GridView1_RowCreated"><Columns><!--其它TemplateField--><asp 阅读全文

posted @ 2011-07-02 15:32 moss_tan_jun 阅读(323) 评论(0) 推荐(0) 编辑

摘要: 前台html:单选: <input type="checkbox" name="isChk" value="22" />全选:<input id="allChk" type="checkbox" name="allChkBox" />js代码://checkbox 选中$(document).ready(function() { $(":checkbox[name='isChk']").click(function( 阅读全文

posted @ 2011-07-02 15:30 moss_tan_jun 阅读(915) 评论(0) 推荐(0) 编辑

摘要: //Response.Write('<script>parent.location='http://www.cnblogs.com/Login/Login.aspx';</script>'); Response.Write('<script>top.location='http://www.cnblogs.com/Login/Login.aspx';</script>'); //Response.Write('<script>parent.document.loc 阅读全文

posted @ 2011-07-02 15:28 moss_tan_jun 阅读(493) 评论(0) 推荐(0) 编辑

摘要: <asp:DataListID="dlTodos"runat="server"RepeatDirection="Horizontal"Visible="false"><ItemTemplate><divstyle="min-width:100px"><divclass="Transformation_left"></div><divclass="Transformation_middle"& 阅读全文

posted @ 2011-07-02 15:27 moss_tan_jun 阅读(250) 评论(0) 推荐(0) 编辑

摘要: GridView是ASP.NET中功能强大的数据显示控件,它的RowDataBound事件为我们提供了方便的控制行、列数据的途径。 软件开发网 www.mscto.com 要获取当前行的某个数据列,有如下几种方法: 1. Cells[x].Txt。 从列单元格的文本值获取。这种方法简单高率,最为常用,但是功能单纯。此法存在几个缺点: (1)无法获取到设置了隐藏属性的数据列的值,所取到的值为“”(空)。 (2)只能获取在HTML中定义过的数据列,无法查询数据源中的当前数据行的所有字段列。一般情况下,通过HTML设置GridView的字段列的数量往往小于数据源的实际字段数量,这是因为从业务逻辑的角 阅读全文

posted @ 2011-07-02 15:23 moss_tan_jun 阅读(316) 评论(0) 推荐(0) 编辑