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 38:     {
Line 39:         //trả về danh sách sản phẩm theo mã sản phẩm
Line 40:         return context.TheLoais.FirstOrDefault(c => c.ID == ma);
Line 41:     }
Line 42: 

Source File: d:\Inetpub\vhosts\dimatourmuine.com\httpdocs\App_Code\Class\TheLoai.cs    Line: 40

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) +345
   System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute(Expression expression) +46
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source, Expression`1 predicate) +422
   TheLoai.LayTheoID(Int32 ma) in d:\Inetpub\vhosts\dimatourmuine.com\httpdocs\App_Code\Class\TheLoai.cs:40
   TheLoai.LayTheoID(String id) in d:\Inetpub\vhosts\dimatourmuine.com\httpdocs\App_Code\Class\TheLoai.cs:45
   Vn_Tour.Page_Load(Object sender, EventArgs e) in d:\Inetpub\vhosts\dimatourmuine.com\httpdocs\Vn\Tour.aspx.cs:15
   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.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


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