摘要: 函数:CREATE FUNCTION [dbo].[UF_XA_UserDataSearch_DepartmentSearch_V40] ( @DepID INT ) RETURNS TABLE AS RETURN ( WITH data AS ( SELECT dt.DepID , dt.DepFatherID FROM dbo.SysDepartment dt WITH (NOLOCK) WHERE dt.DepDelState = 1 AND ( @DepID = -1 OR dt.DepID = @DepID ) UNION ALL SELECT A1.DepID... 阅读全文
posted @ 2013-01-05 12:54 zhuifeng0724 阅读(346) 评论(0) 推荐(0)
摘要: 1.行列转换图1把图1的行转换为图2的列使用2005自带函数 PIVOTPIVOT用于将列值旋转为列名(即行转列),在SQL Server 2000可以用聚合函数配合CASE语句实现PIVOT的一般语法是:PIVOT(聚合函数(列) FOR 列 in (…) )AS P完整语法:table_sourcePIVOT(聚合函数(value_column)FOR pivot_columnIN(<column_list>))UNPIVOT用于将列明转为列值(即列转行),在SQL Server 2000可以用UNION来实现完整语法:table_sourceUNPIVOT(value_col 阅读全文
posted @ 2011-12-28 17:53 zhuifeng0724 阅读(1023) 评论(0) 推荐(0)
摘要: 1.把一个库A的表Product复制到库B表ProductView Code INSERT INTO [库名A].[dbo].[Product] ( [ProCode] , [ProName] , [ProPinyin] , [ProChemicalName] , [ProType] , [ProFormulation] , [ProStandard] , [ProBatch] --.......等 , ... 阅读全文
posted @ 2011-12-26 16:55 zhuifeng0724 阅读(223) 评论(0) 推荐(0)
摘要: 概 述ayGrid是一个基于jQuery的表格插件,可实现在表格上在线修改、增加、删除、保存数据!其中,单元格的编辑可以实现CheckBox、ComboBox、Input的输入方式。表格数据传输基于JSON。如何使用第一节 - 安 装加载JQuery文件。这个是必须的,否则无法运行ayGrid。.<script type="text/javascript" src="jquery-1.4.4.min.js"></script> 加载ayGrid文件。这个是基于jQuery插件文件,也是必须的。<script type=&qu 阅读全文
posted @ 2011-11-02 15:43 zhuifeng0724 阅读(903) 评论(0) 推荐(0)
摘要: View Code <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Demo.aspx.cs" Inherits="WebApplication.Demo" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE ht 阅读全文
posted @ 2011-09-14 15:26 zhuifeng0724 阅读(645) 评论(0) 推荐(0)
摘要: <asp:CustomValidator ID="cvRemark" runat="server" ControlToValidate="txtRemark" Display="None" ClientValidationFunction="RemarkAreaValidation" ErrorMessage="描述限制在1000个汉字以内!<br/>" ValidationGroup="Save"></asp:CustomV 阅读全文
posted @ 2011-09-05 17:25 zhuifeng0724 阅读(413) 评论(0) 推荐(0)
摘要: 1.把传入的中文值进行加密 string name = Server.UrlEncode("中文");Response.Redirect(string.Format("页面?Name={0}",name));2.读取的时候再进行解密 View Code if (!string.IsNullOrEmpty(Request.QueryString["Name"])){ Server.UrlDecode(Request.QueryString["Name"]);} 阅读全文
posted @ 2011-09-02 10:51 zhuifeng0724 阅读(214) 评论(0) 推荐(0)
摘要: 首先触发Page_Load事件。然后GridView知道它关联到一个LinqDataSource,向该控件请求数据。这就导致Selecting和ContextCreating事件被触发。当GridView接收LinqDataSource的数据时,它触发其DataBinding事件通知它将绑定数据到该控件。然后GridView开始创建行。对于数据源中每个项,它创建一行,触发RowCreated事件,将项的数据绑定到行,最后调用RowDataBound。如果仔细地对RowCreated和RowDataBound的调用次数进行计数,则会发现它比数据源中的实际项数多调用两次。这是因为当控件创建... 阅读全文
posted @ 2011-09-02 10:02 zhuifeng0724 阅读(308) 评论(0) 推荐(0)
摘要: <script type="text/javascript"> //保存并刷新 function SaveAndRefresh() { alert('保存成功!'); //window.opener.location.href = window.opener.location.href;或者 window.opener.location.reload(); }//关闭子窗口 function WindowClose() { window.close(); } </script> 阅读全文
posted @ 2011-09-01 16:38 zhuifeng0724 阅读(182) 评论(0) 推荐(0)
摘要: #region Exel文件导出函数 protected object missing = Missing.Value; public string DataSetToExcel(DataTable dt, string tpFile, string filePath, string saveFileName, int templateID, string outFileType) { System.Data.DataTable visibleCol = SysModelTypeLogic.GetVisibleColByTypeAndUserID(templateID, UserState.C 阅读全文
posted @ 2011-08-31 14:38 zhuifeng0724 阅读(376) 评论(0) 推荐(0)