Hi everyone, i am newbie in c#. i have sqlsitemapprovider and stored procedure. i having this problem at this row in sqlsitemapprovider:
DataRow rowRoot = dtSiteMap.Select("[parentId] IS NULL")[0]; //problemhere //
this problem occur everytime i filter my idUserRole in my stored procedure but my dynamic menu bar will work if i did not filter my idUserRole. i already check my datatable, it is empty when i did filter it by idUserRole and it filled if i did not filter it by idUserRole. i stuck in this problem for two week, i have go through every forum but still did not find any solution.
my code sqlsitemapprovider:
DataSet ds = new DataSet();
adapter.Fill(ds, "modulemain");
DataTable dt = new DataTable();
DataTable dtSiteMap = ds.Tables["modulemain"];
DataRow rowRoot = dtSiteMap.Select("[parentId] IS NULL")[0];
rootNode = new SiteMapNode(this,
rowRoot["url"].ToString(), rowRoot["url"].ToString(),
rowRoot["description"].ToString(), rowRoot["description"].ToString());
string rootID = rowRoot["moduleId"].ToString();
my stored procedure:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_SiteMap`()
BEGIN
SELECT A.moduleId, A.Code,A.description,A.url,A.parent AS parentId,A.sequence
, C.`description` AS RoleDesc,D.idUser
FROM modulemain A
LEFT JOIN `moduleitem` B ON A.`moduleId` = B.`ModuleId` AND B.`active` = 1
LEFT JOIN `usermodule` C ON B.`UserModuleId` = C.`idUserModule`
LEFT JOIN `user` D ON C.`idUserModule` = D.`idUserRole`
WHERE A.active = 1 AND D.idUserRole = @idUserRole
ORDER BY A.parent, A.Code, A.sequence;
END$$
any suggestion? many thanks! May god bless you guys!