上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
  2013年3月11日
摘要: 写了一个MVC分页类public class Paging { private Regex regex = new Regex(@"^[0-9]+$"); private int showIcons = 6;//显示的分页按钮数目 private int currentPageIndex;//当前页数 private int totalCount; private int pageSize; private string routeDataPage; public NameValueCollection QueryString{get;set;} public string 阅读全文
posted @ 2013-03-11 21:20 Haydy 阅读(443) 评论(0) 推荐(0) 编辑
  2013年3月8日
摘要: 队列(Queue)是插入操作限定在表的尾部而其它操作限定在表的头部进行的线性表。把进行插入操作的表尾称为队尾(Rear),把进行其它操作的头部称为队头(Front)。当对列中没有数据元素时称为空对列(Empty Queue)。队列通常记为:Q= (a1,a2,…,an),a1为队头元素,an为队尾元素。元素按照a1,a2,…,an的次序依次入队,出队的次序与入队相同,即a1第一个出队,an最后一个出队。所以,对列的操作是按照先进先出(First In First Out)或后进后出( Last In Last Out)的原则进行的,因此,队列又称为FIFO表或LILO表。队列的常用操作有:1、 阅读全文
posted @ 2013-03-08 18:02 Haydy 阅读(801) 评论(0) 推荐(0) 编辑
  2013年3月7日
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Drawing;usingSystem.IO;namespaceMicrosoft.Form.Base{classImageToByte{///<summary>///图片转换成字节流///</summary>///<paramname="img">要转换的Image对象</param>///<returns>转换后返回的字节流</ 阅读全文
posted @ 2013-03-07 15:33 Haydy 阅读(875) 评论(0) 推荐(0) 编辑
  2013年3月5日
摘要: DataFormatString="{0:格式字符串}"在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;数字、货币格式:在指定的格式符号后可以指定小数所要显示的位数。例如原来的数据为「1.56」,若格式设定为 {0:N1},则输出为「1.5」。其常用的数值格式如下表所示: 格式字符串 输入 结果 "{0:C}" 12345.6789 $12,345.68 "{0:C}" -12345.6789 ($12,345.68) "{0:D}" 12345 阅读全文
posted @ 2013-03-05 10:43 Haydy 阅读(261) 评论(0) 推荐(0) 编辑
摘要: C#code方法一.objectsumObject=DataTable.Compute("sum(Qty)","TRUE");直接对数据表中的字段求和,其中Qty的类型为Int整型方法二.doubleColumnSum(DataTabledt,stringColumnName){doubled=0;foreach(DataRowrowindt.Rows){d+=double.Parse(row[ColumnName].ToString());}returnd;}数据表中的字段类型为数字的字符串类型,先用double.Parse()方法将其转化为等效的双精 阅读全文
posted @ 2013-03-05 10:20 Haydy 阅读(993) 评论(0) 推荐(0) 编辑
  2013年2月23日
摘要: 闲着没事写起耍目的:将科目列转换为行1、创建表create table [testTable](id int identity(1,1) primary key,name varchar(20), [subject] varchar(20),score dec (18,2))insert into [testTable] values ('张三','语文',41)insert into [testTable] values ('张三','英语',94)insert into [testTable] values ('张三& 阅读全文
posted @ 2013-02-23 14:17 Haydy 阅读(4544) 评论(0) 推荐(0) 编辑
  2013年2月22日
摘要: create table testDB(id int identity(1,1) primary key,name varchar(20) not null,sales dec(18,2))insert into testDB values('张三',10)insert into testDB values('李四',20)insert into testDB values('王五',30)insert into testDB values('赵立权',40)insert into testDB values('张华 阅读全文
posted @ 2013-02-22 22:00 Haydy 阅读(266) 评论(0) 推荐(0) 编辑
摘要: //须添加对System.Web的引用usingSystem.Web.Security;///<summary>///SHA1加密字符串///</summary>///<paramname="source">源字符串</param>///<returns>加密后的字符串</returns>publicstringSHA1(stringsource){returnFormsAuthentication.HashPasswordForStoringInConfigFile(source,"SHA1 阅读全文
posted @ 2013-02-22 14:34 Haydy 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 在给文章加自定义标签时,需要在存储过程中对输入的字符串按照“,”字符分割成一个字符数组。但是Sql中没有实现字符串分组的Split方 法。因此就需要编写一个自定义的Split函数。我首先是使用表值函数的方法实现的字符串分组,但是在使用中感觉不是很方便。后来又在网上找到了一种使用 两个标量函数,其中一个函数首先返回分割后字符数组的长度,另一个函数依次返回每个分割出的字符串。然后使用循环依次获取分割的字符。表值函数实现Split方法1CreateFUNCTION[dbo].[SplitToTable]2(3@SplitStringnvarchar(max),4@Separatornvarchar( 阅读全文
posted @ 2013-02-22 10:38 Haydy 阅读(249) 评论(0) 推荐(0) 编辑
  2013年2月21日
摘要: SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE function [dbo].[SplitString]( @Input nvarchar(max), @Separator nvarchar(max)=',', @RemoveEmptyEntries bit=1 )returns @TABLE table ( [Id] int identity(1,1), [Value] nvarchar(max)) asbegin declare @Index int, @Entry nvarchar(max) set @Index = 阅读全文
posted @ 2013-02-21 14:37 Haydy 阅读(228) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页