none
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'DocID'.

    Question

  • i try to show documents only for those who uploaded documents

    i mean when ABC login to their account then he/she view only their documents

    here is query

    ALTER procedure [dbo].[sphrdoc2]
    
    @UserID int
    as
    SELECT DocumentInfo.DocID as DocumentID,
    dbo.DocumentInfo.DocName,
    dbo.DocumentInfo.Uploadfile,
    dbo.DocType.DocType,
    dbo.Department.DepType ,
    dbo.ApproveType.ApproveType AS ApproveID
    FROM 
    dbo.DocumentInfo
    inner JOIN dbo.DocType ON dbo.DocumentInfo.DocTypeID=dbo.DocType.DocTypeID
    inner JOIN dbo.Department ON dbo.DocumentInfo.DepID=dbo.Department.DepID
    LEFT JOIN dbo.ApproveType ON dbo.ApproveType.approveid=dbo.Department.DepID where UserID=@UserID


    and here is funtion

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


    here is code on page load

    Repeater1.DataSource = dwwd.gethrdoc22(Convert.ToInt32(Session["UserID"]));
    
                Repeater1.DataBind();


    here is gridview

    <div class="CSSTableGenerator" >
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    				<asp:Repeater ID="Repeater1" runat="server">
    				<HeaderTemplate>
                        <tr>
                            <td>
                               Document ID
                            </td>
                            <td >
                                Document Name
                            </td>
                            <td>
                                File Uploaded
                            </td>
                            <td>
                               Document Type
                            </td>
                            <td>
                                Department Type
                            </td>
                             <td>
                                Approve Name
                            </td>
                        </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                        <tr>
                        <td><%#DataBinder.Eval(Container.DataItem,"DocID") %></td>
    					<td><%#DataBinder.Eval(Container.DataItem,"DocName") %> </td>
    					<td><%#DataBinder.Eval(Container.DataItem,"Uploadfile") %></td>
    					<td><%#DataBinder.Eval(Container.DataItem, "DocType")%></td>
    					<td><%#DataBinder.Eval(Container.DataItem, "DepType")%></td>
    					<td><%#DataBinder.Eval(Container.DataItem, "ApproveType")%></td>
                        </

    but it shows me error in this line

     <td><%#DataBinder.Eval(Container.DataItem,"DocID") %></td>

    ERROR :

    DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'DocID'.

    WHERE IS THE MISTAKE?

    Thursday, October 24, 2013 7:59 AM

Answers