摘要: (1)INSERTINTO SELECT语句语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Table1的字段外,还可以插入常量。(2)SELECTINTO FROM语句语句形式为:SELECT vale1, value2 into Table2 from Table1要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2中。 阅读全文
posted @ 2011-09-20 13:05 晓风拂月 阅读(256) 评论(0) 推荐(0) 编辑
摘要: <SCRIPT LANGUAGE="Javascript">// detection for Netscapevar useAcrobat = navigator.mimeTypes &&navigator.mimeTypes["application/pdf"]</SCRIPT><SCRIPT LANGUAGE="VBScript">on error resume next useAcrobat = not IsNull(CreateObject("AcroExch.Do 阅读全文
posted @ 2011-09-19 21:07 晓风拂月 阅读(720) 评论(1) 推荐(0) 编辑
摘要: str为要去除空格的字符串:去除所有空格: str = str.replace(/\s+/g,""); 去除两头空格: str = str.replace(/^\s+|\s+$/g,"");去除左空格:str=str.replace( /^\s*/, '');去除右空格:str=str.replace(/(\s*$)/g, "");SCRIPT LANGUAGE="JavaScript"> <!-- //出处:网上搜集 // Trim() , Ltrim() , RTrim() Stri 阅读全文
posted @ 2011-09-15 17:40 晓风拂月 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 扩展方法:public static DataTable ConvertToDataTable(thisIEnumerable enumerable){ var dataTable = new DataTable(); foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties(typeof(T))) { dataTable.Columns.Add(pd.Name, pd.PropertyType); } foreach (T item in enumerable) { var Row = dataTable.NewRow(); 阅读全文
posted @ 2011-08-26 18:02 晓风拂月 阅读(3014) 评论(0) 推荐(0) 编辑
摘要: 数据绑定似乎是ASP.NET老掉牙的东西了。可是你知道吗,只需要一点小小的改动就可以替换Eval,摆脱字符串依赖并且大大提高性能。首先在code behind中加入以下方法 protected virtual object ExpHelper<TEntity, TREsult>(Func<TEntity, TREsult> func){ var itm = GetDataItem(); return func((TEntity)itm);}这段代码就是最核心的秘诀了,你完全可以忽视它到底在做什么。其实就是截获每一个被绑定的数据项,并进行强类型转换。假设我们定义了学生类p 阅读全文
posted @ 2011-07-29 16:44 晓风拂月 阅读(267) 评论(0) 推荐(0) 编辑
摘要: <html><head><metahttp-equiv="Content-Type"content="html/text;charset=utf-8"/><title>JSgetParameter</title><scriptsrc="resource/js/param.js"type="text/javascript"></script></head><body><table><tr> 阅读全文
posted @ 2011-03-30 15:49 晓风拂月 阅读(7713) 评论(0) 推荐(0) 编辑
摘要: 判断一个表单是否被修改过,在不少地方需要用到。例如,用户打开一个订单编辑页,过一会后,他要关闭页面,如果用户有修改,那最好能提示下他“请问您确定要离开本页吗?确认离开当前页面吗?/n未保存的数据将会丢失!/n请按“确定”以继续,或者按“取消”回到当前页。”如果用户没有修改,则不用提醒。QWrap里提供了一个判断form是否已有改变的方法,代码如下:View Code /** * 判断form的内容是否有改变 * @method isFormChanged * @param {element} el ... 阅读全文
posted @ 2011-03-05 13:28 晓风拂月 阅读(1535) 评论(0) 推荐(0) 编辑
摘要: <form><inputtype="text"value="defaultValue1"/><inputtype="text"value="defaultValue2"/><textarea>defaultValue1</textarea><textarea>defaultValue2</textarea><inputtype="radio"name="a"/>test<in 阅读全文
posted @ 2011-03-04 14:03 晓风拂月 阅读(364) 评论(0) 推荐(0) 编辑
摘要: --判断数据库是否存在 if exists(select * from master..sysdatabases where name=N’库名’) print ’exists’ else print ’not exists’ --------------- -- 判断要创建的表名是否存在 if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[表名]’) and OBJECTPROPERTY(id, N’IsUserTable’) = 1) -- 删除表 drop table [dbo].[表名] GO -- 阅读全文
posted @ 2011-03-02 22:47 晓风拂月 阅读(209) 评论(0) 推荐(0) 编辑
摘要: --这个是截取字符串的函数,在生成存储过程的时候调用了gocreate function [dbo].[f_split](@SourceSql varchar(max),@StrSeprate varchar(10)) returns @temp table(Rowvalue varchar(1000))as begin declare @i int set @SourceSql=rtrim(ltrim(@SourceSql)) set @i=charindex(@StrSeprate,@SourceSql) while @i>=1 begin insert @temp values(l 阅读全文
posted @ 2011-03-02 22:28 晓风拂月 阅读(2369) 评论(0) 推荐(0) 编辑
摘要: js 代码function checkLen(obj,len){if(obj.value.replace(/[^/x00-/xFF]/g,'**').length>=len){obj.value=leftUTFString(obj.value,len);}}function getStringUTFLength(str) { var value = str.replace(/[^/x00-/xff]/g," "); return value.length; } function leftUTFString(str,len) { if(getString 阅读全文
posted @ 2011-02-21 15:09 晓风拂月 阅读(4340) 评论(0) 推荐(0) 编辑
摘要: onKeyUp="this.value=this.value.replace(//D/g,'')" onafterpaste="this.value=this.value.replace(//D/g,'')" 阅读全文
posted @ 2011-02-19 13:29 晓风拂月 阅读(271) 评论(0) 推荐(0) 编辑
摘要: js 取得CheckBoxList的选中项的值,遍历RadioButtonList获取CheckBoxList的值var CheckBoxList=document.all.CheckBoxList1; var objCheckBox,CheckValue="";for(i=0;i<CheckBoxList.rows.length;i++) { objCheckBox = document.getElementById("CheckBoxList1_" + i); if(objCheckBox.checked == true) { CheckVal 阅读全文
posted @ 2011-01-27 16:49 晓风拂月 阅读(252) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文
posted @ 2011-01-16 14:35 晓风拂月 阅读(300) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文
posted @ 2011-01-16 14:30 晓风拂月 阅读(197) 评论(0) 推荐(0) 编辑
摘要: $(document).ready(function(){$("#addPayOrder").linkbutton({text:"添加"});$("#editPayOrder").linkbutton({text:"修改"});$("#delPayOrder").linkbutton({text:"删除"});//绑定右键菜单$("#TRData").bind("contextmenu",function(e){$("#men 阅读全文
posted @ 2011-01-16 14:27 晓风拂月 阅读(890) 评论(6) 推荐(0) 编辑
摘要: <%Dim xlWorkSheetDim xlApplicationSet xlApplication = Server.CreateObject("Excel.Application")xlApplication.Visible = FalsexlApplication.Workbooks.AddSet xlWorksheet = xlApplication.Worksheets(1)set oRS=Server.CreateObject("ADODB.Recordset")if Request("ImportExcel")= 阅读全文
posted @ 2011-01-16 14:16 晓风拂月 阅读(259) 评论(0) 推荐(0) 编辑