跟小D每日学口语
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 77 下一页
摘要: 1. TOP 表达式SQL Server 2000的TOP是个固定值,是不是觉得不爽,现在改进了。--前n名的订单declare@nintset@n=10selectTOP(@n)*fromOrders2. 分页不知各位过去用SQL Server 2000是怎么分页的,大多都用到了临时表。SQL Server 2005一句话就支持分页,性能据说也非常不错。select*from(selectOrderId,Freight,ROW_NUMBER()OVER(orderbyFreight)asrowfromOrders)awhererowbetween20and303. 排名select*from 阅读全文
posted @ 2011-05-21 19:51 Danny Chen 阅读(127) 评论(0) 推荐(0) 编辑
摘要: View Code 1 try 2 { 3 VQP.Common.FZip fileZip = new VQP.Common.FZip(); 4 fileZip.FileNamesToZIP = new List<string>(); 5 fileZip.FileNamesToZIP.Add(@"C:\test.txt"); 6 fileZip.FileNameZipped = @"C:\test.zip"; 7 fileZip.ZipFiles(); 8 } 9 catch (Exception ex)10 {11 lblMessage.T 阅读全文
posted @ 2011-05-20 15:32 Danny Chen 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 1. Get(即使用QueryString显式传递) 方式:在url后面跟参数。 特点:简单、方便。 缺点:字符串长度最长为255个字符;数据泄漏在url中。 适用数据:简单、少量、关键的数据。 适用范围:传递给自己、传递给另一个目标页面;常用于2个页面间传递数据。 用法:例如:url后加?UserID=…,跳转到目标页面,目标页面在伺服端可用Request.QueryString["InputText"]获取其指定参数值。http://www.itokit.com2. Post 方式:通用的方式。利用form提交。 特点:最常用的方法。常用技巧是把隐秘的数据存在隐藏域中由 阅读全文
posted @ 2011-05-20 14:23 Danny Chen 阅读(309) 评论(0) 推荐(0) 编辑
摘要: .net2.0,虽然也有一个解压缩的类,但是好像并不怎么受欢迎。不过我们还可以选择别SharpZipLib。我从网上找了一些代码,有些做了修改,已经测试可以使用。解压缩操作类:using System; using System.Collections.Generic; using System.Web.UI.WebControls; using System.Web; using System.Text; using System.IO; using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Checksums; n 阅读全文
posted @ 2011-05-19 22:41 Danny Chen 阅读(1007) 评论(0) 推荐(0) 编辑
摘要: 最近工作中写了几个存储过程,需要向存储过程中传递字符串,因为SQL Server 2000中没有内置类似于 split 的函数,只好自己处理,将前台数据集中的一列用逗号拆分存到一个List<string>中,再转化为字符串传给存储过程,很是麻烦。今天看了下SQL Server 2008的新特性,发现有表变量的使用,及其将DataTable作为参数的用法,就尝试了一下,简单谈谈心得。示例代码下载一、测试环境1、Windows Server 2008 R2 DataCenter2、Visual Studio 2008Team SystemWith SP13、SQL Server 200 阅读全文
posted @ 2011-05-19 10:02 Danny Chen 阅读(3254) 评论(0) 推荐(0) 编辑
摘要: I've been looking for help on how to find objects in Generics with List.Find() method .... and ... take a look what I have found. In the follow example, I created a simple class:public class Person { private int _id; private string _name; public int ID { get{ return _id;} set{ _id = value;}} pub 阅读全文
posted @ 2011-05-18 18:33 Danny Chen 阅读(16009) 评论(0) 推荐(0) 编辑
摘要: HTML code<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list2.aspx.cs" Inherits="Datalist_list2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 阅读全文
posted @ 2011-05-18 18:30 Danny Chen 阅读(643) 评论(0) 推荐(0) 编辑
摘要: <script language="javascript" type="text/javascript"> //去掉字串左边的空格 function lTrim(str) { if (str.charAt(0) == " ") { //如果字串左边第一个字符为空格 str = str.slice(1); //将空格从字串中去掉 //这一句也可改成 str = str.substring(1, str.length); str = lTrim(str); //递归调用 } return str; } //去掉字串右边的空格 阅读全文
posted @ 2011-05-18 10:40 Danny Chen 阅读(256) 评论(0) 推荐(0) 编辑
摘要: ASP.Net处理Http Request时,使用Pipeline(管道)方式,由各个HttpModule对请求进行处理,然后到达HttpHandler,HttpHandler处理完之后,仍经过Pipeline中各个HttpModule的处理,最后将HTML发送到客户端浏览器中。生命周期中涉及到几个非常重要的对象:HttpHandler,HttpModule,IHttpHandlerFactory,他们的执行顺序大致的执行过程是这样的:client端发送页面请求,被IIS的某个进程截获,它根据申请的页面后缀(.aspx)不同,调用不同的页面处理程序(.asp->asp.dll; .asp 阅读全文
posted @ 2011-05-15 23:07 Danny Chen 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 有关于URL的重写,本文也只是拿来主意。相继有MS的组件“URLRewriter”和在Global.asax里的“Application_BeginRequest()”编码方式,以及IIS里的ISAPI设置。娜列下来,实现方法也都很简单。方法一:MS组件这里也不用详解了,相关请看:http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx用法很简单,只需要把组件URLRewriter.dll拷到应用程序的bin目录下,然后在web.config下加入如下代码:在<configurati 阅读全文
posted @ 2011-05-15 22:52 Danny Chen 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 77 下一页