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

Comments

Popular posts from this blog

How to Convert Word Document to PDF using C#

Loop Through Dates in SQL