摘要: 比如: public class LineItem { [Key] public int OrderId { get; set;} [Key] public int LineNum { get; set;} public string ItemId { get; set;} public int Quantity { get; set;} public decimal UnitPrice { get; set; } }编译时会出现如下错误:Unable to determine co... 阅读全文
posted @ 2013-03-18 21:34 James·wang 阅读(2489) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.ComponentModel.DataAnnotations; namespace CloudOne.Models{ public class Blog { public int BlogID { get; set; } public int CategoryID { get; set; } [MaxLength(70)] [Required... 阅读全文
posted @ 2013-03-18 17:25 James·wang 阅读(238) 评论(0) 推荐(0)
摘要: http://harvesthq.github.com/chosen/ 阅读全文
posted @ 2013-03-13 13:25 James·wang 阅读(202) 评论(0) 推荐(0)
摘要: 用的是_window.Open()方式打开的窗口(风声js的window插件打开子窗口) ,类似于window.open()//用于刷新父窗口整个页面window.parent.location.reload();parent.subWindow_add.Close();//风声js的window插件关闭窗口,类似于window.close()//刷新父页面中的id为“4thEditTable”的列表(局部刷新)parent.$("#4thEditTable").load(window.parent.location.href+" #4thEditTable&qu 阅读全文
posted @ 2013-03-08 22:44 James·wang 阅读(1809) 评论(0) 推荐(0)
摘要: 在BLL里注意声明过程方法为public类型,不然无法使用类中定义的过程方法! 阅读全文
posted @ 2013-03-03 01:11 James·wang 阅读(394) 评论(0) 推荐(0)
摘要: 用户名 [\w\-]{3,12} 3-12个字符(包括英文字母、数字、'-'、'_')密码 [\x21-\x7E]{3,8} 3-8个常用字符(0x21到0x7E)年龄 1[0-2]\d|\d{1,2} 最大129岁日期 (19|20)\d{2}[/\s\-\.]*(0[1-9]|1[0-2]|[1-9])[/\s\-\.]*(0[1-9]|3[01]|[12][0-9]|[1-9]) 不含时间的日期,没有处理2月29日的情况(19|20)\d{2}[/\s\-\.]*(0[1-9]|1[0-2]|[1-9])[/\s\-\.]*(0[1-9]|3[01]|[1 阅读全文
posted @ 2013-03-02 18:43 James·wang 阅读(261) 评论(0) 推荐(0)
摘要: 很多时候删除某个元素后,我们都希望回到原来的页面,如何实现呢?假设在XController的index.cshtml(或aspx)中有:<a><href = "/area/XController/delete?id=10">删除</a>,为了让删除后回到index页面,可以使用:<a><href = "/area/XController/delete?id=10&backUrl=" + @Request.Url.ToString()>且在XController.cs中,将原来的<p 阅读全文
posted @ 2013-02-28 11:41 James·wang 阅读(2659) 评论(1) 推荐(1)
摘要: 操作符 如果源序列是空的 源序列只包含一个元素 源序列包含多个元素 First 返回null 返回该元素 返回第一个元素 FirstOrDefault 返回default(TSource) 返回该元素 返回第一个元素 Last 抛异常 返回该元素 返回最后一个元素 LastOrDefault 返回d 阅读全文
posted @ 2013-02-27 21:41 James·wang 阅读(22313) 评论(6) 推荐(6)
摘要: 1、泛型:泛型是一种特殊的类型,它把指定类型的工作推迟到客户端代码声明并实例化类或方法的时候进行。例如,通过使用泛型类型参数 T,您可以编写其他客户端代码能够使用的单个类,而不致引入运行时强制转换或装箱操作的成本或风险,如下所示:// 声明 generic 类public class GenericList<T>{ void Add(T input) { }}class TestGenericList{ private class ExampleClass { } static void Main() { // 声明list为整数类型int ... 阅读全文
posted @ 2013-02-21 09:48 James·wang 阅读(1027) 评论(1) 推荐(1)
摘要: 数据库 C#程序 int int32 text string bigint int64 binary System.Byte[] bit Boolean char string datetime System.DateTime decimal System.Decimal float System.Double image System.Byte[] money System.Decimal nchar String ntex... 阅读全文
posted @ 2013-02-05 10:56 James·wang 阅读(1206) 评论(0) 推荐(0)