i try to show documents with specific department id

computer-science admin will be able to view only computer-science documents and hr admin view only hr documents

here i create a sp

ALTER procedure [dbo].[sphrdocid1]

     @DepID int
    SELECT DocumentInfo.DocID,
   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  

then when i test the query and write this "sphrdocid1 6" it show me like this

 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**

and on page load function

GrdFileApprove.DataSource = dd.gethrdoc22(Convert.ToInt32(Session["Userid"]));


 public DataTable hrdoc1(int id)
        return db.ExecuteDataSet("sphrdocid1", new object[] { id }).Tables[0];


when i set a breakpoint it shows me id 0 ..

and when i debug it can not show me any documents in form

where is the probelem?
Re: view current user documents in asp.net 80 80

Where is hrdoc1 called? Where is id set?

Re: view current user documents in asp.net 80 80

hrdocid1 is sp and id is set in funtion..
DataTable table = db.ExecuteDataSet("sphrdocid1", new object[] { id }).Tables[0];

        return table;
Re: view current user documents in asp.net 80 80

Your trying to turn a DataSet into a Table explicitly which might not work ... try this:

 public DataTable hrdoc1(int id)
    DataSet ds = (Call DataSet here)
    DataTable dt = ds.tables[0];
    return dt;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.