05 2012 档案

摘要:本文来自 CSDN 博客 作者:Cici Cheng在前三 节中探讨了假分页,假分页最大的弊端就是从数据库服务器取出了很多数据,却只是显示其中的一小部分,以此为例,每次页面加载时,IIS服务器都会从 SQLSERVER数据库服务器提取3144条数据,而实际上却只有10条呈现给了用户,这样极大的浪费了服务器资源。从这一节开始我们来探讨真分页,真 分页也就是只取需要显示的数据,比如每页显示10条,那就只从数据库服务器取出10条,然后予以呈现,这样就极大的节约了系统资源,这种分页在当今IT市 场上极为通用的一种用法。要达到此目的,就需要先获取当前查询条件下能获取的总的数据条数,然后再告诉服务器我要去 阅读全文
posted @ 2012-05-30 11:08 KyrieYang 阅读(303) 评论(0) 推荐(1) 编辑
摘要:select * from O_OrderWovenLabelselect row_number()over(order by Size )as RowNum,*from O_OrderWovenLabelROW_NUMBER() OVER (ORDER BY id desc)为SQL2005新增函数,表示取出每一列的行号 阅读全文
posted @ 2012-05-30 09:58 KyrieYang 阅读(15579) 评论(0) 推荐(3) 编辑
摘要:Select no=Identity(int,1,1),* Into #temptable From O_OrderWovenLabel Select * From #temptable 阅读全文
posted @ 2012-05-30 09:13 KyrieYang 阅读(1709) 评论(0) 推荐(0) 编辑
摘要:class Program { static void Main(string[] args) { int[] arr = new int[] { 49, 38, 65, 97, 76, 13, 27 }; Sort(arr); for (int i = 0; i < arr.Length; i++) { Console.WriteLine("得到"+arr[i]); }}public static void Sort(int[] list) { int i, j, temp; bool done = false; j = 1; while((j<list.Le 阅读全文
posted @ 2012-05-29 10:21 KyrieYang 阅读(131) 评论(0) 推荐(0) 编辑
摘要:if (!(filename.EndsWith(".jpg") || filename.EndsWith(".gif"))) { Label10.Text = "图片只能是jpg,gif格式"; return; } 阅读全文
posted @ 2012-05-28 17:32 KyrieYang 阅读(2131) 评论(0) 推荐(0) 编辑
摘要:'加载Excel数据 Private Function LoadExcelData(ByVal Path As String) txtMsg.Text = "Excel数据导入中..." Dim msgError As String = "" Dim miss As Object = System.Reflection.Missing.Value Dim wss As Excel.Sheets Dim ws As Excel.Worksheet = Nothing Dim excelApp As Excel.Application = New E 阅读全文
posted @ 2012-05-28 14:58 KyrieYang 阅读(726) 评论(0) 推荐(0) 编辑
摘要:function Check_FileType() { var str=document.getElementById("FileUpload1").value; //即得到上传图片框里的值,也就是路径 if(str==""||str==null) //判断是否为空 { alert("Please upload pictures"); return false; } var pos=str.lastIndexOf("."); //得到.的位置 var lastname=str.substring(pos,str.l 阅读全文
posted @ 2012-05-17 09:20 KyrieYang 阅读(268) 评论(0) 推荐(0) 编辑
摘要:USE [ShimadaWebOrder ]GO/****** Object: StoredProcedure [dbo].[sp_orderState_handl] Script Date: 05/16/2012 14:35:27 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[sp_orderState_handl]( @RefNo varchar(500), --订单号 @CustID varchar(50) --登录编号)asbegin declare @CmdText varchar(8000 阅读全文
posted @ 2012-05-16 15:28 KyrieYang 阅读(3429) 评论(0) 推荐(0) 编辑
摘要:public static void CreateFile() { string filename = @"E:\Test\NewFile.txt"; //在什么路径下创建什么文件NewFile.txt(可以根据自已需要传入参数,路径也可以变化) try { FileStream fs = File.Create(filename);//表示在该路径下创建文件 //准备装文本写入文件,将字符串转换为合适的格式,以便可以存储在Byte类型的数组中 Byte[] info = new UTF8Encoding(true).GetBytes("把数据写入到了NewFil 阅读全文
posted @ 2012-05-16 12:22 KyrieYang 阅读(3245) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Data;using System.Collections.Generic;using System.Text;using System.IO;using Excel = Microsoft.Office.Interop.Excel;using System.Text.RegularExpressions;using System.Threading;using System.Globalization;using System.Net.Mail;using Yokohama.ApplicationBlocks.Data;namespace 阅读全文
posted @ 2012-05-15 10:47 KyrieYang 阅读(286) 评论(0) 推荐(0) 编辑
摘要:c#实现按日期命名上传文件代码,做开发的应该能够用得了吧! “附件说明”边的TextBox:Id=TextBox1 “浏览”:Id=UpLoadFile “上传”:Id=AddFile 文件目录:wwwroot/myWeb/userfiles/upload private void AddFile_Click(object sender, System.EventArgs e) { if(UpLoadFile.PostedFile.FileName.Trim()!="") { String fileName =UpLoadFile.PostedFile.FileName.S 阅读全文
posted @ 2012-05-14 14:50 KyrieYang 阅读(1878) 评论(0) 推荐(0) 编辑
摘要:create function chengji(@inputkc as varchar(10)) --定义参数 声明参数类型returns @chji Table --表类型 返回值( xs_name varchar(10), xf int)asbegin insert @chji select xs.xs_name,xs.xf from xs where xs_name=@inputkc return endselect * from dbo.chengji('wj') 阅读全文
posted @ 2012-05-10 15:54 KyrieYang 阅读(196) 评论(0) 推荐(0) 编辑
摘要:SQL部分ALTER PROCEDURE [dbo].[sp_ChangePassword]( @CustID VARCHAR(10), @OldPassword VARCHAR(10), @NewPassword VARCHAR(10) )ASIF EXISTS(SELECT * FROM dbo.A_User WHERE CustID=@CustID and [Password]=@OldPassword)BEGIN UPDATE dbo.A_user SET [Password]=@NewPassword WHERE CustID=@CustID SELECT result=1 ---. 阅读全文
posted @ 2012-05-10 15:10 KyrieYang 阅读(454) 评论(0) 推荐(0) 编辑
摘要:ALTER procedure [dbo].[sp_A_UserLogin] ( @CustID varchar(10), --登录编码 @Password varchar(10),--用户密码 @flag int output, --输出错误信息 @Activate int output,--是否激活 @groupID int output --权限组 ) as declare @num int --表示执行成功显示的条数 declare @Activatebool int --账号是否激活 declare @Login_qx int --登录权限 begin select ... 阅读全文
posted @ 2012-05-06 16:51 KyrieYang 阅读(306) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示