roledal.cs
来自「一个简单的网上书店」· CS 代码 · 共 32 行
CS
32 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using BLL;
using BLL.interfaces;
using Model;
namespace DAL
{
public class RoleDal
{
public List<UserRoles> sel()
{
string sqlStr = "select * from userroles";
List<UserRoles> list = new List<UserRoles>();
using(SqlDataReader read=DBHelp.Sel(sqlStr))
{
while(read.Read())
{
UserRoles role = new UserRoles();
role.Id=int.Parse(read["id"].ToString());
role.Name = read["name"].ToString();
list.Add(role);
}
return list;
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?