Here is the SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:NewsCenterConnectionString %>" SelectCommand="SELECT top 5 [id], [itemdate], [title], [description], [photo] FROM [Announcements] WHERE (previewonly = 0) ORDER BY itemdate DESC"></asp:SqlDataSource>
Here is the Repeater Code:
<asp:Repeater ID="DataList1" DataSourceID="SqlDataSource1" runat="server">
<ItemTemplate>
<div class="NewsCenter_listitem">
<div class="NewsCenter_Title"><a href='<%# "newscenter/News_View.aspx?Articleid=" + Convert.ToString(Eval("ID"))%>'>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("title") %>' />
</a></div>
<div class="NewsCenter_thumbnail"><a href='<%# "newscenter/News_View.aspx?Articleid=" + Convert.ToString(Eval("ID"))%>'><DCC:ImageThumbnail ID="ImageThumbnail2" runat="server" NoPhotoImg="App_Themes/Theme_NewsCenter/images/background_thumbnail.jpg" PhotoID='<%# Eval("photo") %>' ImageSize="FullSize" />
</a></div>
<div>
<asp:Label ID="Label2" CssClass="ListItemDescription" runat="server" Text='<%# SharedRoutines.truncate((string)Eval("description")) %>' />
</div>
<div class="lblDate" style="margin:3px">
<asp:Label ID="lblDate" runat="server" Text='<%# Eval("itemdate","{0:D}") %>' />
</div>
<a href='<%# "newscenter/News_View.aspx?Articleid=" + Convert.ToString(Eval("ID")) %>' style="text-decoration:underline"> read more »</a>
<div style="text-align: right; padding-top:2px; padding-bottom:2px;"> <img alt="" hspace="0" align="center" border="0" src="assets/images/bar2.gif" /></div>
<div class="NewsCenter_clearlist"> </div>
</div>
</ItemTemplate>
</asp:Repeater>
Event Viewer Message:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/22/2009 4:35:14 PM
Event time (UTC): 9/22/2009 9:35:14 PM
Event ID: 9f2e25c17fd240e284185d11722f523a
Event sequence: 1777
Event occurrence: 17
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-85-128981282593510557
Trust level: Full
Application Virtual Path: /
Application Path: e:\Inetpub\wwwroot\
Machine name: MYWEBSERVER
Process information:
Process ID: 4144
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
Request information:
Request URL: http://www.mywebsite.com/ImageFetch.ashx?Size=2&ImageID=19
Request path: /ImageFetch.ashx
User host address: xxx.xxx.xxx.xxx
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 7
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at ImageFetch.writeSingleImage(Int32 ImageID, Int32 size, Stream output)
at ImageFetch.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)