(大家好像都忽视了的问题)自己定义一个表格,然后把库中内容显示出来,该怎样做?
先定义好一个表格,把内容贴上去,我觉得这样更能控制显示的效果。
以前在ASP是这样的:
<table width="98%" class="tableframe" align="center">
<tr class="Listtitle">
<td width="13%" class="ListCellTitle" height="3">
<div align="center">标题</div>
</td>
<td width="13%" class="ListCellTitle" height="3">
<div align="center">发布日期</div>
</td>
</tr>
<%
Do While not rs.eof AND RowCount > 0
%>
<tr class="listrow1">
<td width="13%" height="4" class="ListCellRow">
<div align="center"><%=rs("title")%></div>
</td>
<td width="13%" height="4" class="ListCellRow">
<div align="center"><%= rs("date") %> </div>
</td>
</tr>
<%
rs.movenext
RowCount = RowCount - 1
Loop
%>
</table>
现在我怎样把dataGrid中的数据绑定对应的位置(我不想在页面中夹杂代码)
我已在对应的cs文件中写了:
string str_Sql = "select title AS "+标题+", fbdw AS "+标题+" , fbrq AS "+发布日期+" from xxxxx";
接下来该怎么写?