简体   繁体   English

数据绑定:“ System.Data.DataRowView”不包含名称为“ DocID”的属性

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

i try this query to view documents only for those who uploaded through their account means user only view their own documents query 我尝试使用此查询来查看仅针对通过其帐户上传的用户的文档,这意味着用户只能查看自己的文档查询

 ALTER procedure [dbo].[dddddd]
   @userid int
   as                     
   SELECT DISTINCT DocumentInfo.DocID as DocumentID ,
    dbo.DocumentInfo.DocName as DocumentName,
    dbo.DocumentInfo.Uploadfile as FileUploaded,
    dbo.DocType.DocType as Document,
    dbo.Department.DepType as Department ,
    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.DocumentInfo.ApproveID   
    LEFT    
    OUTER JOIN
    Approval a ON a.DocID = a.DocID
    JOIN
    ApproveType at ON at.ApproveID = ISNULL(a.Approveid, 3)  where UserID=@userid

but it shows me error 但它显示我错误

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

in this line 在这条线

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

where is the mistake 错误在哪里

There is no DocID being returned in your query as you have aliased the column to be DocumentID . 由于将列别名为DocumentID查询中没有返回DocID。

Change to this instead: 改为此:

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

Also is your left outer join correct? 您的left outer join是否正确? You seem to be using the same table on both sides of the query. 您似乎在查询的两边都使用了相同的表。 More of an observation. 更多的观察。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数据绑定:&#39;System.Data.DataRowView&#39; 不包含名为 &#39;Rating&#39; 的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Rating' 数据绑定:“ System.Data.DataRowView”不包含名称为“名称”的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Name' 数据绑定:“ System.Data.DataRowView”不包含名称为“任务列表”的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Tasklist' DataBinding:“ System.Data.DataRowView”不包含名称为“ image”的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'image' 数据绑定:“ System.Data.DataRowView”不包含名称为“ AddDate”的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'AddDate' 数据绑定:“ System.Data.DataRowView”不包含名称为“ CityNameHotel_Name”的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'CityNameHotel_Name' DataBinding:&#39;System.Data.DataRowView&#39;不包含名称为可搜索gridview的属性 - DataBinding: 'System.Data.DataRowView' does not contain a property with the name for searchable gridview 修复数据绑定:“ System.Data.DataRowView”不包含名称为“ - Fix- DataBinding: 'System.Data.DataRowView' does not contain a property with the name 为什么数据绑定:“ System.Data.DataRowView”不包含名称为“ xxx”的属性? - Why DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'xxx'? 错误:- 数据绑定:“System.Data.DataRowView”不包含名为“Optiont4”的属性 - ERROR :- DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Optiont4'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM