select top 6 distinct W_S_name from S_Week order by W_W_grade desc ";这样子写会出错
下面是图,姓名重复了,现在想把重复的去掉
前台代码
<div style="width: 100%; background-color: #ffffff; height: 300px;">
<table cellpadding="0" cellspacing="0" style="height: 300px; width: 100%;">
<tr>
<td style="width: 690px; height: 300px;">
<div class="divtabletop" style="width: 690px; height: 25px">
::本周优秀学生
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#">More>></asp:HyperLink>
</div>
<div class="divtablebody" style="width: 690px; height: 270px">
<asp:DataList ID="DataList1" runat="server" Height="270px" RepeatColumns="3" RepeatDirection="Horizontal"
Width="690px" Font-Names="宋体" Font-Size="13px">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" style="font-size: 13px; font-family: 宋体">
<tr>
<td align="center" rowspan="2" valign="middle">
<img height="120" src='../picture/student/<%# DataBinder.Eval(Container.DataItem, "W_S_picture")%>' width="110"
style="border-top-style: none; border-right-style: none; border-left-style: none;
border-bottom-style: none" alt="a" /></a>
</td>
<td valign="middle" style="width: 150px; height: 22px;" align="left">
<img height="15" src="../Images/dot_1.gif" style="width: 25px" alt="d" /><a href='#.aspx?id=<%# DataBinder.Eval(Container.DataItem, "W_S_id")%> '><strong><%# DataBinder.Eval(Container.DataItem, "W_S_name")%></strong></a>
</td>
</tr>
<tr>
<td style="width: 150px; height: 53px" align="left">
<img height="11" src="../Images/dot_1.gif" width="24" alt="b" />分数: ¥<%# DataBinder.Eval(Container.DataItem, "W_W_grade")%>分<br />
<br />
<img height="11" src="../Images/dot_1.gif" width="24" alt="c" />老师: <a href='#.aspx?id=<%# DataBinder.Eval(Container.DataItem, "W_S_teacher_name")%>'>
<%# DataBinder.Eval(Container.DataItem, "W_S_teacher_name")%>
</a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
</td>
<td style="width: 200px; height: 300px; text-align: center;" valign="top">
<uc1:Userlogin ID="Userlogin1_1" runat="server"></uc1:Userlogin>
</td>
</tr>
</table>
</div>
后台
strsql = "select top 6 * from S_Week order by W_W_grade ";
dt = BaseClass1.ReadTable(strsql);
DataList1.DataSource = dt;
DataList1.DataBind();