Hi.
The field (caption_id) is in the query but I get the following error!!!
The field's name is correctly written in query.
DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'caption_id'.
Dim dat2 As SqlClient.SqlDataReader
Dim com_str As String
com_str = "Select TOP (5) id, caption, SUBSTRING(context, 1, 140) AS context, photo, date_submit, caption_id, date_day, date_month, date_year, date_minute, date_hour FROM news;"
Dim com1 As New SqlClient.SqlCommand(com_str, connection.sql_connect)
dat2 = com1.ExecuteReader
DataList2.DataSource = dat2
DataList2.DataBind()
dat2.Close()
<asp:DataList ID="DataList2" runat="server" Height="53px" Width="523px">
<ItemTemplate>
<table border="0" style="width: 99%; height: 147px">
<tr>
<td align="right">
<a style="text-decoration: none;" href='news-detail.aspx?news_id=<%#DataBinder.Eval(Container.DataItem, "id")%>&caption_id=<%#DataBinder.Eval(Container.DataItem, "caption_id")%>'><img style="border:0" src="images/continue.jpg" />
</a>
</td>
</tr>
<tr>
<td align="right" height="143" rowspan="3" style="width: 162px">
<img Height="140" Width="158" src='news-images/<%# DataBinder.Eval(Container.DataItem,"photo") %>' /></td>
<td valign="top" align="right" height="26" style="font-family: Tahoma; font-size: 9pt; color: #000000; font-weight: bold"><%#DataBinder.Eval(Container.DataItem, "caption")%></td>
</tr>
<tr>
<td valign="top" align="justify" dir="rtl" height="92" style="font-family: Tahoma; font-size: 10pt; color: #000000"><%#DataBinder.Eval(Container.DataItem, "context")%><a dir="rtl">....</a></td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>