Tuesday, 3 January 2012

sample XML query for tree control binding geographies

SELECT 1 AS [Tag],
0 AS [Parent],
NULL AS [geographies!1],
NULL AS [geography!2!ID],
NULL AS [geography!2!Name]
UNION
SELECT DISTINCT 2
,1
,NULL
,PopularGeoID
,Title
FROM PopularGeographyMaster
WHERE(@strSearch = '' OR (@strSearch!='' AND Title LIKE '%' + @strSearch + '%' ))
order by 4,5
FOR XML EXPLICIT

No comments:

Post a Comment