public static UserInfo[] GetAllUsers() { ArrayList al = new ArrayList(); int retValue = -1; //Generated Code for query : dbo.GetAllVendors using (SqlDataReader dr = ProjManagementAdmin.GetAllUsers(out retValue)) //Initialize and retrieve code for Datareader goes here { while (dr.Read()) { UserInfo user = new UserInfo(); user.UserName = dr["user_name"].ToString(); user.UserId = Convert.ToInt32(dr["user_id"]); user.UserEmail = dr["user_email"].ToString(); user.ChangedByName = dr["changed_by"].ToString(); al.Add(user); } //dr.Close(); } UserInfo[] allInfo = new UserInfo[al.Count]; al.CopyTo(allInfo); return(allInfo); }