首页 新闻 会员 周边

DataBinding:“System.Data.DataRowView”不包含名为“user”的属性

0
悬赏园豆:50 [已解决问题] 解决于 2016-02-21 13:30

这张表中,只有psId,和photoId,posttime能被访问出来,访问其他的就会出现我所说的问题,求助,求助

问题补充:

sql语句如下:

select top 10 * from userPhotos order by psId

超级学渣渣的主页 超级学渣渣 | 初学一级 | 园豆:158
提问于:2016-02-19 21:30
< >
分享
最佳答案
0

把SqlDataSource和DataList的代码贴全

收获园豆:50
jello chen | 大侠五级 |园豆:7336 | 2016-02-20 09:58
 <td class="auto-style2">最新上传照片</td>
  </tr>
  <tr>
    <td class="auto-style2">
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:photoDataConnectionString %>" SelectCommand="select top 10 * from userPhotos order by photoId"></asp:SqlDataSource>
        
        <asp:DataList ID="DataList4" runat="server" DataKeyField="photoId" DataSourceID="SqlDataSource2">
            <ItemTemplate>
            <%#Eval("Name") %>
            </ItemTemplate>
        </asp:DataList>
      </td>
  </tr>
</table>
    </div>
超级学渣渣 | 园豆:158 (初学一级) | 2016-02-21 12:44

这里是没有什么错的,我检查后发现,是建表的时候,表名称多了一个空格,我去,太坑了。谢谢你了。

超级学渣渣 | 园豆:158 (初学一级) | 2016-02-21 13:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册