Little background. I'm taking certain elements from a winforms application and creating a webforms app.
The first element is a Timeline, data for the timeline is stored in a MS SQL database. There are two tables 'timeline' and 'timeLineAttachments'. The timeline table contains the timeline's post text, time posted, post by who etc, if the post has any image attachments then the column 'attachment' will be 'True'. In the timeLineAttachments table there is a refID column which will store the id value from the timeline table.
So if the post has attachments in SQL I would call stored procedure 'getTimeLineAttachments' and pass the ID from the timeline post. Then the stored procedure will return any images where refID = id.
I have added a datalist to my webform and attached it to a stored procedure. Currently I have the following code on my timeline.aspx
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<Table Class="table">
<tr>
<td>
<div class="accountName">
<asp:Label ID="accountNameLabel" runat="server" Text='<%# Eval("accountName") %>' />
<br />
<span class="addedByDetails">
<asp:Label ID="addedByLabel" runat="server" Text='<%# Eval("addedBy") %>' /> added this Note on <asp:Label ID="dateTimeLabel" runat="server" Text='<%# Eval("dateTime") %>' />
<%-- <asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>' />--%>
</span></div>
<div id="shell">
<asp:Label ID="messageLabel" runat="server" Text='<%# Eval("message") %>' />
</div>
<div runat="server" Visible='<%# Eval("attachment")%>'>
</div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smartshadeConnectionString %>" SelectCommand="001Web7DayTimeLine" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
My question is how do I call my stored procedure and then display the returned images. What I want to do is go get the attachments from my timelineAttachments table and display them here:
<div runat="server" Visible='<%# Eval("attachment")%>'>
*** IF the <%# Eval("attachment")%> is True then I want to get immages from SQL based on the Eval("id") ***
</div>
I've look around and I cant find any good tutorials on how to even get close to this. Any help would be appreciated.