Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

OutOfMemoryException Binding ObjectDataSource to GridView

$
0
0

I've built a really simple page that binds a GridView to a ObjectDataSource. The code works fine everywhere I run it except in a specific site in on IIS8. The same code files in a new site on the same server, using the same ApplicationPool, works fine. What could possibly cause an OutOfMemoryException on one site and not another? The problematic site is actually running AspDotNetStorefront, however, the page doesn't reference any AspDotNetStorefront code, so I can't imagine it would be their code.

Given the nature of the error (no breakpoints in the page even get it, it just goes straight to the error) I don't know how to effectivly debug this.

My page:

<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title></title></head><body><form id="Form1" method="post" runat="server"><asp:GridView ID="gvHistory" runat="server" DataSourceID="dsHistory"></asp:GridView><asp:ObjectDataSource ID="dsHistory" runat="server" SelectMethod="GetHistoryRows"
        TypeName="AspDotNetStorefrontAdmin.ROIImportHistory"></asp:ObjectDataSource></form></body></html>

In my App_Code folder:

Imports System.Data

Namespace AspDotNetStorefrontAdmin

    Public Class ROIImportHistory

        Public Shared Function GetHistoryRows() As DataTable

            Dim localDatatable As New DataTable

            localDatatable.Columns.Add()
            localDatatable.Columns.Add()
            localDatatable.Columns.Add()
            localDatatable.Rows.Add(New Object() {"Hi", "Hi2", "Hi3"})

            Return localDatatable

        End Function
    End Class

End Namespace

The exception:

Server Error in '/' Application.
Exception of type 'System.OutOfMemoryException' was thrown.
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.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

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:


[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName) +.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +.Web.UI.WebControls.DataBoundControl.PerformSelect() +.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +.Web.UI.Control.EnsureChildControls() +.Web.UI.Control.PreRenderRecursiveInternal() +.Web.UI.Control.PreRenderRecursiveInternal() +.Web.UI.Control.PreRenderRecursiveInternal() +.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +: Microsoft .NET Framework Version:2.0.50727.6400; ASP.NET Version:2.0.50727.6387 

Any suggests are very welcome. Thanks.


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>