初识三层架构(5)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-02 17:48 点击:次
37 DataRow row =dt.Rows[0];
38 Person person = new Person();
39 person.Id = (int)row["Id"];
40 person.Name = (string)row["Name"];
41 person.Age =Convert.ToInt32( row["Age"]);
42 return person;
43 }
44 else
45 {
46 throw new Exception("未知数据错误!");
47 }
48 }
49 public static IEnumerable<Person> GetAllPerson()
50 {
51 DataTable dt = SQLHelper.ExecuteDataTable("select * from T_Person");
52 List<Person> list = new List<Person>();
53 foreach (DataRow row in dt.Rows)
54 {
55 Person person = new Person();
56 person.Id = (int)row["Id"];
57 person.Name = (string)row["Name"];
58 person.Age = Convert.ToInt32(row["Age"]);
59 list.Add(person);
60 }
61 return list;
62 }
63 }
64 }
BLL
1 using 三层架构.Model;
2 using 三层架构.DAL;
3 using System;
4 using System.Collections;
5 using System.Collections.Generic;
6
7 namespace 三层架构.BLL
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- 步步为营 SharePoint 开发学习笔记系列&nb
- ASP.net页面中请求远程Web站点
- 用OpenXml在文档的尾部添加一个Rich Text Content Con
- 使用ASP.NET MVC3+EF+Jquery制作文字直播系统(一
- Request.Cookies 和 Response.Cookies 的区别
- 向Excel文档中嵌入VBA控件和UserForm并显示
- ASP.NET生成高质量缩略图通用函数(c#代码)
- ASP.NET之Gridview图解(1)
- Spring.Net学习系列一: 统一异常处理
- ASP.NET FormsAuthentication跨站点登录时绝对地址返



