public ArrayList GetUserRoles( int UserID ) { ArrayList roles = new ArrayList( ); DBSqlControls sqc = new DBSqlControls( ); SqlCommand comm = sqc.CreateCommand( ); comm.CommandType = CommandType.Text; comm.CommandText = @"SELECT db_Group.Name FROM dbGroup INNER JOIN db_UserGroup ON db_UserGroup.GroupID = db_Group.Name WHERE db_UserGroup.UserID=@UserID"; comm.Parameters.AddWithValue( "@UserID", UserID ); SqlDataReader dr; try { dr = comm.ExecuteReader( ); while ( dr.Read( ) ) { roles.Add( dr["RoleName"].ToString( ) ); } } catch ( SqlException ex ) { throw ex; } finally { comm.Connection.Close( ); } return roles; }