上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: declare@sqlstrvarchar(3000) set@sqlstr='declare@subsqlstrvarchar(1000);' set@sqlstr=@sqlstr+'set@subsqlstr=''select*fromtblproducts'';' set@sqlstr=@sqlstr+'execute(@subsqlstr)' execute(@sqlstr)在上面的代码中,@SQL变量中定义的是一组SQL语句,在这组SQL语句中,又定义了一个@SUBSQL变量,在其中存放了SELECT语句 阅读全文
posted @ 2013-02-20 09:51 yellowshorts 阅读(2539) 评论(0) 推荐(0) 编辑
摘要: select ServiceStaff, * from Project_Hdr where Id=12原查询结果 'XM2053,XM205'执行下面语句select code=substring(a.ServiceStaff,b.number,charindex(',',a.ServiceStaff+',',b.number+1)-b.number),* from Project_Hdr a, master..spt_values b where b.type='p' and b.number<=len(a.Service 阅读全文
posted @ 2013-02-20 09:18 yellowshorts 阅读(280) 评论(0) 推荐(0) 编辑
摘要: string num=12num.PadLeft(4, '0'); //结果为为 '0012'看字符串长度是否满足4位,不满足则在字符串左边以"0"补足 阅读全文
posted @ 2013-02-19 14:59 yellowshorts 阅读(5333) 评论(0) 推荐(0) 编辑
摘要: int[] numbers=new int [20]; //建立一个数组 Random rand=new Random (); //生成随机数 string result=""; //保存结果 for (int i = 0; i < 20; i++) //初始化数组 numbers[i] = i+1; for (int i = 0; i < 20; i++) //洗牌{int temp = rand.Next(20); int tempNumber = numbers[i ]; numbers[i] = numbers[temp ]; numbers[temp] 阅读全文
posted @ 2013-02-19 14:56 yellowshorts 阅读(288) 评论(0) 推荐(0) 编辑
摘要: <%@ OutputCache Duration="15" VaryByParam="none" %> 使用页面输出缓存<%@ OutputCache Duration="3600" VaryByParam="id" %> 使用参数变化输出缓存<%@ OutputCache Duration="3600" VaryByControl="DropDownList1" %> 基于控件变化的输出缓存<%@ OutputCache Durat 阅读全文
posted @ 2013-02-18 16:26 yellowshorts 阅读(216) 评论(0) 推荐(0) 编辑
摘要: //在session状态中保存数据库数据 DataView dvMovies; dvMovies = (DataView)Session["Movies"]; if (dvMovies==null) { string constring = "Data Source=.;Initial Catalog=BalloonShop;Integrated Security=True"; SqlDataAdapter dad = new SqlDataAd... 阅读全文
posted @ 2013-02-18 10:46 yellowshorts 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1//记录页面被请求的次数 int counter = 0; if (Request.Cookies["counter"]!=null) { counter = Int32.Parse(Request.Cookies["counter"].Value);//读取cookies } counter++; Response.Cookies["counter"].Value = counter.ToString();//创建cookies ... 阅读全文
posted @ 2013-02-18 10:08 yellowshorts 阅读(144) 评论(0) 推荐(0) 编辑
摘要: var MyConnectionString = @"Data Source=.;Initial Catalog=BalloonShop;Integrated Security=True"; using (SqlConnection Myconnection = new SqlConnection(MyConnectionString)) { Myconnection.StatisticsEnabled = true;//启用信息收集 var MySql = "select * from Category"; v... 阅读全文
posted @ 2013-02-17 17:38 yellowshorts 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 数据生成树使用存储过程在数据表中生成树数据库 Category1表结构________________________________________CREATE TABLE [dbo].[Category1]( [id] [int] IDENTITY(1,1) NOT NULL, [pid] [int] NULL, [Name] [varchar](100) NULL, [path] [varchar](255) NULL, [sort] [varchar](255) NULL, [isHot] [bit] NULL, [keywords] [text] NULL, [description 阅读全文
posted @ 2013-02-17 17:09 yellowshorts 阅读(234) 评论(0) 推荐(0) 编辑
摘要: var MyNumber = 123056.78; string[] MyScale = { "分", "角", "元", "拾", "伯", "仟", "万", "拾", "伯", "仟", "亿", "拾", "伯", "仟", "兆", "拾", "伯" 阅读全文
posted @ 2013-02-17 10:11 yellowshorts 阅读(237) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页