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:


Line 106:    public List<TheLoai> LayTheoLoaiMenuVaIDParentIsNull(int ma)
Line 107:    {
Line 108:        var a = (from b in context.TheLoais
Line 109:                    where b.IDLoaiMenu == ma && b.IDParent == null                     
Line 110:                    orderby b.ThuTu 

Source File: d:\Inetpub\vhosts\nuocmamngocdinh.com\httpdocs\App_Code\Class\TheLoai.cs    Line: 108

Stack Trace:


[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IntPtr method) +0
   System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType) +10341450
   System.Data.Linq.SqlClient.ObjectReaderCompiler.Compile(SqlExpression expression, Type elementType) +563
   System.Data.Linq.SqlClient.SqlProvider.GetReaderFactory(SqlNode node, Type elemType) +213
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +542
   System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +45
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +471
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +78
   TheLoai.LayTheoLoaiMenuVaIDParentIsNull(Int32 ma) in d:\Inetpub\vhosts\nuocmamngocdinh.com\httpdocs\App_Code\Class\TheLoai.cs:108
   Vn_UC_Header.Page_Load(Object sender, EventArgs e) in d:\Inetpub\vhosts\nuocmamngocdinh.com\httpdocs\Vn\UC\Header.ascx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8964; ASP.NET Version:2.0.50727.8962