I dont know why getlist doesnt exist.
i resolved the problem by execute this sql script.
In the orginal script are errors !??
Original:
Order By E.[Level], e.[Displayname] error !
changed:
Order By E.[Level], e.[ListName] ok!
CREATE procedure GetList
@ListName nvarchar(50),
@ParentKey nvarchar(150),
@DefinitionID int
AS
If @ParentKey = ''
Begin
Select DISTINCT
E.[ListName],
E.[Level],
E.[DefinitionID],
E.[ParentID],
(SELECT MAX([SortOrder]) FROM Lists WHERE [ListName] = E.[ListName]) As [MaxSortOrder],
(SELECT COUNT(EntryID) FROM Lists WHERE [ListName] = E.[ListName] AND ParentID = E.[ParentID]) As EntryCount,
IsNull((SELECT [ListName] + '.' + [Value] + ':' FROM Lists WHERE [EntryID] = E.[ParentID]), '') + E.[ListName] As [Key],
IsNull((SELECT [ListName] + '.' + [Text] + ':' FROM Lists WHERE [EntryID] = E.[ParentID]), '') + E.[ListName] As [DisplayName],
IsNull((SELECT [ListName] + '.' + [Value] FROM Lists WHERE [EntryID] = E.[ParentID]), '') As [ParentKey],
IsNull((SELECT [ListName] + '.' + [Text] FROM Lists WHERE [EntryID] = E.[ParentID]), '') As [Parent],
IsNull((SELECT [ListName] FROM Lists WHERE [EntryID] = E.[ParentID]),'') As [ParentList]
From Lists E (nolock)
where ([ListName] = @ListName or @ListName='')
and (DefinitionID = @DefinitionID or @DefinitionID = -1)
Order By E.[Level], e.[ListName]
End
Else
Begin
DECLARE @ParentListName nvarchar(50)
DECLARE @ParentValue nvarchar(100)
SET @ParentListName = LEFT(@ParentKey, CHARINDEX( '.', @ParentKey) - 1)
SET @ParentValue = RIGHT(@ParentKey, LEN(@ParentKey) - CHARINDEX( '.', @ParentKey))
Select DISTINCT
E.[ListName],
E.[Level],
E.[DefinitionID],
E.[ParentID],
(SELECT MAX([SortOrder]) FROM Lists WHERE [ListName] = E.[ListName]) As [MaxSortOrder],
(SELECT COUNT(EntryID) FROM Lists WHERE [ListName] = E.[ListName] AND ParentID = E.[ParentID]) As EntryCount,
IsNull((SELECT [ListName] + '.' + [Value] + ':' FROM Lists WHERE [EntryID] = E.[ParentID]), '') + E.[ListName] As [Key],
IsNull((SELECT [ListName] + '.' + [Text] + ':' FROM Lists WHERE [EntryID] = E.[ParentID]), '') + E.[ListName] As [DisplayName],
IsNull((SELECT [ListName] + '.' + [Value] FROM Lists WHERE [EntryID] = E.[ParentID]), '') As [ParentKey],
IsNull((SELECT [ListName] + '.' + [Text] FROM Lists WHERE [EntryID] = E.[ParentID]), '') As [Parent],
IsNull((SELECT [ListName] FROM Lists WHERE [EntryID] = E.[ParentID]),'') As [ParentList]
From Lists E (nolock)
where [ListName] = @ListName And
[ParentID] = (SELECT [EntryID] From Lists Where [ListName] = @ParentListName And [Value] = @ParentValue)
Order By E.[Level], e.[ListName]
End
I user SQL2005 Express, after DNN install ther is no Getlist.
By using SQL2000 there is GetList.
is there a BUG?
thx