上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 114 下一页
摘要: 1.引入以下js和css 2. html代码如下 3.后台代码如下: public ActionResult News() { var list = db.Artists.Select(m => new { value=m.Name}).ToLi... 阅读全文
posted @ 2015-09-28 11:26 甜菜波波 阅读(176) 评论(0) 推荐(0)
摘要: 1.引用如下js和css 代码 2.验证代码 3. html代码@using(Html.BeginForm("form")){ @Html.TextBoxFor(m => m.titlenew); @Html.ValidationMes... 阅读全文
posted @ 2015-09-28 10:50 甜菜波波 阅读(458) 评论(0) 推荐(0)
摘要: 测试实体类 public class Test { public int id{get;set;} [Required(ErrorMessage="不能为空喔")] [StringLength(10,ErrorMessage="字符串不能超过10")]... 阅读全文
posted @ 2015-09-28 10:44 甜菜波波 阅读(181) 评论(0) 推荐(0)
摘要: 有时我们需要从DataTable中抽取Distinct数据,以前总是以对DataTable进行foreach之类纯手工方式获取。近来发现DataView可以帮我们直接获取Distinct数据,汗一个!DataTable dataTable;DataView dataView = dataTable.... 阅读全文
posted @ 2015-09-25 11:22 甜菜波波 阅读(726) 评论(0) 推荐(0)
摘要: [Key] //主键 [DatabaseGenerated(DatabaseGeneratedOption.Identity)] //设置自增 public int id { get; set; } [ForeignKey("catego... 阅读全文
posted @ 2015-09-23 11:21 甜菜波波 阅读(15579) 评论(0) 推荐(1)
摘要: SELECT INTO 和 INSERT INTO SELECT 两种表复制语句 Insert是T-sql中常用语句,Insert INTO table(field1,field2,...) values(value1,value2,...)这种形式的在应用程序开发中必不可少。但我们在开发、测试过... 阅读全文
posted @ 2015-09-23 10:26 甜菜波波 阅读(13088) 评论(0) 推荐(0)
摘要: ef join 用法var customers = DB.Customer.Join(DB.Commission,cst => cst.CommissionId,com => com.CommissionId, (cst, com) => new Customer(){CommissionId = ... 阅读全文
posted @ 2015-09-17 15:05 甜菜波波 阅读(774) 评论(0) 推荐(1)
摘要: 1、左连接:var LeftJoin = from emp in ListOfEmployeesjoin dept in ListOfDepartmenton emp.DeptID equals dept.ID into JoinedEmpDeptfrom dept in JoinedEmpDept... 阅读全文
posted @ 2015-09-17 14:07 甜菜波波 阅读(953) 评论(0) 推荐(1)
摘要: 1.在global.asax void Application_Start(object sender, EventArgs e) { // 在应用程序启动时运行的代码 // RouteConfig.RegisterRoutes(RouteT... 阅读全文
posted @ 2015-09-17 11:43 甜菜波波 阅读(394) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Tran... 阅读全文
posted @ 2015-09-16 18:01 甜菜波波 阅读(143) 评论(0) 推荐(0)
上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 114 下一页