StringBuilder sbSites = new StringBuilder();
sbSites.Append("
if (ddlManagingSite.SelectedValue != string.Empty)
{
sbSites.AppendFormat("
}
else
{
foreach (ListItem item in ddlManagingSite.Items)
{
if (item.Text != "")
{
sbSites.AppendFormat("
}
}
}
sbSites.Append("
SP need to look like this
CREATE PROC [dbo].[uspGetVacancyNoticeBoardByStateAndSite]
@vcSiteCode varchar(MAX)='
AS
DECLARE @iDocSites INT
EXEC sp_xml_preparedocument @iDocSites OUTPUT, @vcSiteCode
SELECT
[ID],
[LastDataUpdateDate],
[LastDataUpdateBy]
FROM [dbo].[tblVacancyNoticeBoard]
WHERE [SiteCode] IN (SELECT SiteCodeID FROM OPENXML (@iDocSites, '/AllSITES/SiteCode', 1) WITH (SiteCodeID VARCHAR(5)))
No comments:
Post a Comment