public List <School房间信息表> 查询房间信息表(int id) { try { StringBuilder sb = new StringBuilder(); string sql = string.Format("SELECT * FROM 房间信息表 WHERE 建筑物ID = {0} ", id); SqlDataReader read = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); List <School房间信息表> list = new List <School房间信息表>(); School房间信息表 modelx = new School房间信息表(); modelx.ID = 0; modelx.称 = "全部"; list.Add(modelx); while (read.Read()) { School房间信息表 model = new School房间信息表(); model.ID = Convert.ToInt32(read["ID"]); model.称 = read["名称"].ToString(); list.Add(model); } return(list); } catch (Exception) { throw; } }
public List <School房间信息表> cfdd() { try { StringBuilder sb = new StringBuilder(); sb.Append(" SELECT * from dbo.房间信息表"); SqlDataReader read = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sb.ToString()); List <School房间信息表> list = new List <School房间信息表>(); while (read.Read()) { School房间信息表 model = new School房间信息表(); model.ID = Convert.ToInt32(read["ID"]); model.称 = read["名称"].ToString(); list.Add(model); } return(list); } catch (Exception) { throw; } }