【发布时间】:2011-10-16 16:37:57
【问题描述】:
我正在尝试使用 ListView 控件显示数据库中的数据列表,如下所示:
员工姓名:xxxxxxxxx ID:111111 职位名称:yyyyyxxxx 组织:uuuuuu
这意味着我想在一个包含 4 列的表中列出数据,其顺序如下: 财产 价值 财产 价值
我修改了这个样式,我成功了。我现在的问题是在两个值列中从数据库中检索数据。我不知道该怎么做。
我的部分代码:
<LayoutTemplate>
<table border="0" cellpadding="1">
<tr style="background-color:#003366; color:white">
<th align="left"> Employee Name </th>
<td>
</td>
<th align="left">ID</th>
<td></td>
</tr>
<tr style="background-color:#003366; color:white">
<th align="left">Job Title.</th>
<td></td>
<th align="left">Organization</th>
<td></td>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
【问题讨论】:
-
看看这些链接:how to add the items coming from the database to the list view using asp.net and c#(来自 scottgu 的优秀材料)和Complete Listview。