我尝试显示具有特定部门 ID 的文档
计算机科学管理员将只能查看计算机科学文档,而人力资源管理员只能查看人力资源文档
在这里我创建了一个 sp
ALTER procedure [dbo].[sphrdocid1]
@DepID int
as
SELECT DocumentInfo.DocID,
dbo.DocumentInfo.DocName,
dbo.DocumentInfo.Uploadfile,
dbo.DocType.DocType,
dbo.Department.DepType ,
dbo.ApproveType.ApproveType AS ApproveID
FROM dbo.DocumentInfo
left JOIN dbo.DocType ON dbo.DocumentInfo.DocTypeID=dbo.DocType.DocTypeID
left JOIN dbo.Department ON dbo.DocumentInfo.DepID=dbo.Department.DepID
LEFT JOIN dbo.ApproveType ON
dbo.ApproveType.approveid=dbo.Department.DepID
where
dbo.Department.DepID=@DepID
然后当我测试查询并写下这个“sphrdocid1 6”时,它会像这样显示我
DocID DocDesciption DocName Uploadfile DocTypeID
**DepID** **UploadedBy** UserID
8 paperssSSS SDASDASD dsfsdf.docx 1
**4** **john** **6**
9 hr report dr reprt n analysis HR.docx 1
**4** **john** **6**
和页面加载功能
GrdFileApprove.DataSource = dd.hrdoc1(Convert.ToInt32(Session["a"]));
GrdFileApprove.DataBind();
和
public DataTable hrdoc1(int id)
{
return db.ExecuteDataSet("sphrdocid1", new object[] { id }).Tables[0];
}
当我设置断点时,它显示我 id 0 ..
当我调试时,它无法向我显示任何形式的文档
问题在哪里?