日期:2014-05-17 浏览次数:20879 次
public static List<AriticleGroup> SearchGroupNameByUserId(int userId) { List<AriticleGroup> groups = new List<AriticleGroup>(); string sql = string.Format("select groupId,groupName from AriticleGroup where userId={0}", userId); SqlDataReader reader = ConnectionSQL.ExecuteSelect(sql); AriticleGroup group = null; while (reader.Read()) { group = new AriticleGroup(); group.AriticleGroupId = (int)reader["groupId"]; group.AriticleGroupName = reader["groupName"].ToString(); groups.Add(group); } reader.Close(); ConnectionSQL.CloseConn(); return groups; }