AJH.CMS.Core.Data.UserDataMapper.GetUsersNotInRole C# (CSharp) Method

GetUsersNotInRole() static private method

static private GetUsersNotInRole ( int RoleID ) : List
RoleID int
return List
        internal static List<User> GetUsersNotInRole(int RoleID)
        {
            List<User> colUsers = null;
            User user = null;

            using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
            {
                SqlCommand sqlCommand = new SqlCommand(SN_USER_GET_NOT_IN_ROLE, sqlConnection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter parameter = new SqlParameter(RoleDataMapper.PN_ROLE_ID, System.Data.SqlDbType.Int);
                parameter.Direction = System.Data.ParameterDirection.Input;
                parameter.Value = RoleID;
                sqlCommand.Parameters.Add(parameter);

                sqlCommand.Connection.Open();
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    colUsers = new List<User>();
                    while (sqlDataReader.Read())
                    {
                        user = GetUser(colUsers, sqlDataReader);
                        FillFromReader(user, sqlDataReader);
                    }

                    sqlDataReader.Close();
                    sqlCommand.Connection.Close();
                }
            }
            return colUsers;
        }