CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    42

    Exception of type 'System.OutOfMemoryException' was thrown.

    Exception of type 'System.OutOfMemoryException' was thrown.

    when importing from excel to database i get the above error

    i am importing from excel sheet and inserting in db
    i am aware its the memory issue
    i mean i tried with excel sheet having less columns , its gets imported properly
    but if column or records increases than i get the issue
    is it directly related to system memory or buffering or asp.net worker process as i have 2 GB RAM
    file size is 255 KB with 107 records & 77 columns
    still i get the error

    ome mor ething i am not able to even import the excel with 10 records & 77 columns

    but if the columns are reduced i can insert the records

    Code:
    ?ex.GetBaseException()
    {"Exception of type 'System.OutOfMemoryException' was thrown."}
        [System.OutOfMemoryException]: {"Exception of type 'System.OutOfMemoryException' was thrown."}
        Data: {System.Collections.ListDictionaryInternal}
        HelpLink: null
        InnerException: null
        Message: "Exception of type 'System.OutOfMemoryException' was thrown."
        Source: "mscorlib"
        StackTrace: "   at System.String.Concat(String str0, String str1)\r\n   at MYPRJ._Default.cmdimport_Click(Object sender, EventArgs e) in D:\\MYPRJ\\MYPRJ\\Default.aspx.cs:line 731"
        TargetSite: {System.String Concat(System.String, System.String)}
    ?ex.InnerException
    null
    ?ex.GetObjectData
    'System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' is a 'method', which is not valid in the given context
    ?ex.Source
    "mscorlib"
    
    ?ex.GetHashCode()
    40686163
    ?ex.Data
    {System.Collections.ListDictionaryInternal}
        [System.Collections.ListDictionaryInternal]: {System.Collections.ListDictionaryInternal}
        IsFixedSize: false
        IsReadOnly: false
        Keys: {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}
        Values: {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}
    ex.GetType
    'System.Exception.GetType()' is a 'method', which is not valid in the given context
    ex.GetType()
    {Name = "OutOfMemoryException" FullName = "System.OutOfMemoryException"}
        [System.RuntimeType]: {Name = "OutOfMemoryException" FullName = "System.OutOfMemoryException"}
        base {System.Reflection.MemberInfo}: {Name = "OutOfMemoryException" FullName = "System.OutOfMemoryException"}
        Assembly: {mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
        AssemblyQualifiedName: "System.OutOfMemoryException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        Attributes: Public | Serializable | BeforeFieldInit
        BaseType: {Name = "SystemException" FullName = "System.SystemException"}
        ContainsGenericParameters: false
        DeclaringMethod: 'ex.GetType().DeclaringMethod' threw an exception of type 'System.InvalidOperationException'
        DeclaringType: null
        FullName: "System.OutOfMemoryException"
        GenericParameterAttributes: 'ex.GetType().GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'
        GenericParameterPosition: 'ex.GetType().GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'
        GUID: {ccf306ae-33bd-3003-9cce-daf5befef611}
        HasElementType: false
        IsAbstract: false
        IsAnsiClass: true
        IsArray: false
        IsAutoClass: false
        IsAutoLayout: true
        IsByRef: false
        IsClass: true
        IsCOMObject: false
        IsContextful: false
        IsEnum: false
        IsExplicitLayout: false
        IsGenericParameter: false
        IsGenericType: false
        IsGenericTypeDefinition: false
        IsImport: false
        IsInterface: false
        IsLayoutSequential: false
        IsMarshalByRef: false
        IsNested: false
        IsNestedAssembly: false
        IsNestedFamANDAssem: false
        IsNestedFamily: false
        IsNestedFamORAssem: false
        IsNestedPrivate: false
        IsNestedPublic: false
        IsNotPublic: false
        IsPointer: false
        IsPrimitive: false
        IsPublic: true
        IsSealed: false
        IsSerializable: true
        IsSpecialName: false
        IsUnicodeClass: false
        IsValueType: false
        IsVisible: true
        MemberType: TypeInfo
        Module: {CommonLanguageRuntimeLibrary}
        Namespace: "System"
        ReflectedType: null
        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
        TypeHandle: {System.RuntimeTypeHandle}
        TypeInitializer: null
        UnderlyingSystemType: {Name = "OutOfMemoryException" FullName = "System.OutOfMemoryException"}
    Last edited by GremlinSA; November 19th, 2011 at 03:30 PM. Reason: Please use [Code] Tags

  2. #2
    Join Date
    Feb 2002
    Location
    Mumbai, India
    Posts
    242

    Re: Exception of type 'System.OutOfMemoryException' was thrown.

    Did you try using DTS and executing the package using ASP.Net
    Hope this helps. If it does, then rate it.
    ----
    Rohit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured