标签:style http io ar color os sp 文件 on
一 web.config
<add name="ERPEntities"
connectionString="Data Source=.;Initial Catalog=TOMERP;User ID=sa;Password=aswere2012"
providerName="System.Data.SqlClient"/>
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace ERP.Models
{
public class ERPEntities:DbContext
{
public DbSet<Province> Provinces { set; get; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
namespace ERP.Models
{
/// <summary>
/// 省份
/// </summary>
public class Province
{
[Key]
public int ProvinceID { set; get; }
[Display(Name="省份名称")]
[Required(ErrorMessage="省份名称 必填")]
public string ProvinceName { set; get; }
[Display(Name = "省份编码")]
public string ProvinceCode { set; get; }
}
}
标签:style http io ar color os sp 文件 on
原文地址:http://www.cnblogs.com/mahun/p/4116314.html