We have a aspx page on a web server that was created by someone who has now left our company which for some reason just started throwing an error, i have been looking into reasons for about 3 days now and am not getting any where, can any one put me in the right direction?
The error is:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Navision_sales_type_details.Page_Load(Object sender, EventArgs e) +101
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +24
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +41
System.Web.UI.Control.OnLoad(EventArgs e) +131
System.Web.UI.Control.LoadRecursive() +65
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082
The source code to the page being launch is
Expand|Select|Wrap|Line Numbers
- <%@ page language="C#" autoeventwireup="true" inherits="Navision_SalesInvoiceReport, App_Web_dev_rfop" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>Sales Invoice Report</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div style="text-align: center">
- <br />
- <br />
- <asp:Button ID="Button1" runat="server" BackColor="#336699" BorderStyle="Ridge" Font-Bold="True"
- Font-Names="Arial" ForeColor="#FFFFFF" OnClick="Button1_Click" Text="Export to Excel"
- Width="165px" /><br />
- <br />
- <br />
- <asp:GridView ID="GridView1" runat="server"
- AutoGenerateColumns="False" CellPadding="4" DataKeyNames="No_" DataSourceID="SqlDataSource1"
- ForeColor="#333333" GridLines="None" PageSize="20">
- <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
- <Columns>
- <asp:BoundField DataField="No_" HeaderText="No_" ReadOnly="True" SortExpression="No_" />
- <asp:BoundField DataField="Sell-to Customer No_" HeaderText="Sell-to Customer No_"
- SortExpression="Sell-to Customer No_" />
- <asp:BoundField DataField="Bill-to Customer No_" HeaderText="Bill-to Customer No_"
- SortExpression="Bill-to Customer No_" />
- <asp:BoundField DataField="Bill-to Name" HeaderText="Bill-to Name" SortExpression="Bill-to Name" />
- <asp:BoundField DataField="Ship-to Name" HeaderText="Ship-to Name" SortExpression="Ship-to Name" />
- <asp:BoundField DataField="Order Date" HeaderText="Order Date" SortExpression="Order Date" />
- <asp:BoundField DataField="Posting Date" HeaderText="Posting Date" SortExpression="Posting Date" />
- <asp:BoundField DataField="Shortcut Dimension 1 Code" HeaderText="Shortcut Dimension 1 Code"
- SortExpression="Shortcut Dimension 1 Code" />
- <asp:BoundField DataField="Shortcut Dimension 2 Code" HeaderText="Shortcut Dimension 2 Code"
- SortExpression="Shortcut Dimension 2 Code" />
- <asp:BoundField DataField="Sell-to Customer Name" HeaderText="Sell-to Customer Name"
- SortExpression="Sell-to Customer Name" />
- <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
- <asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" />
- <asp:BoundField DataField="Unit Price" HeaderText="Unit Price" SortExpression="Unit Price" />
- <asp:BoundField DataField="Unit Cost (LCY)" HeaderText="Unit Cost (LCY)" SortExpression="Unit Cost (LCY)" />
- <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
- <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
- <asp:BoundField DataField="Salesperson Code" HeaderText="Salesperson Code" SortExpression="Salesperson Code" />
- <asp:BoundField DataField="item_number" HeaderText="item_number" SortExpression="item_number" />
- <asp:BoundField DataField="Profit Amount" HeaderText="Profit Amount" SortExpression="Profit Amount" />
- <asp:BoundField DataField="Profit Margin %" HeaderText="Profit Margin %" SortExpression="Profit Margin %" />
- </Columns>
- <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
- <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
- <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
- <EditRowStyle BackColor="#999999" />
- <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:navision %>"
- SelectCommand="SELECT [fakecompany Solutions Limited$Sales Invoice Header].No_, [fakecompany Solutions Limited$Sales Invoice Header].[Sell-to Customer No_], [fakecompany Solutions Limited$Sales Invoice Header].[Bill-to Customer No_], [fakecompany Solutions Limited$Sales Invoice Header].[Bill-to Name], [fakecompany Solutions Limited$Sales Invoice Header].[Ship-to Name], [fakecompany Solutions Limited$Sales Invoice Line].Type, CONVERT (varchar(11), [fakecompany Solutions Limited$Sales Invoice Header].[Order Date], 103) AS [Order Date], CONVERT (varchar(11), [fakecompany Solutions Limited$Sales Invoice Header].[Posting Date], 103) AS [Posting Date], [fakecompany Solutions Limited$Sales Invoice Header].[Shortcut Dimension 1 Code], [fakecompany Solutions Limited$Sales Invoice Header].[Shortcut Dimension 2 Code], [fakecompany Solutions Limited$Sales Invoice Header].[Sell-to Customer Name], [fakecompany Solutions Limited$Sales Invoice Line].Description, [fakecompany Solutions Limited$Sales Invoice Line].Quantity, [fakecompany Solutions Limited$Sales Invoice Line].[Unit Price], [fakecompany Solutions Limited$Sales Invoice Line].[Unit Cost (LCY)], [fakecompany Solutions Limited$Sales Invoice Line].Amount, [fakecompany Solutions Limited$Sales Invoice Header].[Salesperson Code], [fakecompany Solutions Limited$Sales Invoice Line].No_ AS item_number, [fakecompany Solutions Limited$Sales Invoice Line].[Profit Amount], [fakecompany Solutions Limited$Sales Invoice Line].[Profit Margin %] FROM [fakecompany Solutions Limited$Sales Invoice Line] INNER JOIN [fakecompany Solutions Limited$Sales Invoice Header] ON [fakecompany Solutions Limited$Sales Invoice Line].[Document No_] = [fakecompany Solutions Limited$Sales Invoice Header].No_ WHERE ([fakecompany Solutions Limited$Sales Invoice Header].[Posting Date] > GETDATE())">
- </asp:SqlDataSource>
- </div>
- </form>
- </body>
- </html>