ASP.NET2.0学习5--N层代码示例(一)
时间:2007-03-13 来源:wansheng2092
ASP.NET2.0学习5--N层代码示例
一、数据库Test,
表:create table Customers
(
CustId int IDENTITY(1,1) primary key,
CustName varchar(20) not null,
Address varchar(50),
Linkman varchar(20)
)
//insert into Cusomers values('ggg','xuzhou','zhangsan');
二、配置文件web.config
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="TestConnectionString" connectionString="Data Source=GONGCHL;Initial Catalog=Test;Persist Security Info=True;User ID=sa;Password=123" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
</configuration>
三、业务实体
using System;
using System.Collections.Generic;
using System.Text;
namespace com.Model
{
/// <summary>
/// 业务实体CustomerInfo
/// </summary>
[Serializable]
public class CustomerInfo
{
/// <summary>
/// 默认的构造函数
/// </summary>
public CustomerInfo() {}
/// <summary>
/// 有参数的构造函数
/// </summary>
/// <param name="custId">客户号</param>
/// <param name="custName">客户名称</param>
/// <param name="address">客户地址</param>
/// <param name="linkman">联系人</param>
public CustomerInfo(int custId, string custName, string address, string linkman)
{
this.custId = custId;
this.custName = custName;
this.address = address;
this.linkman = linkman;
}
private int custId;
public int CustId
{
get { return custId; }
set { custId = value; }
}
private string custName;
public string CustName
{
get { return custName; }
set { custName = value; }
}
private string address;
public string Address
{
get { return address; }
set { address =

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载- 4 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载73.78MB · 90℃
1970-01-01
- 5 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载43.7 MB · 95℃
1970-01-01
- 6 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载110.69MB · 97℃
1970-01-01