mkhuwaja / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

IErrorInfo.GetDescription failed with E_FAIL(0x80004005) when calling New ExcelQueryFactory(FileFullPath) #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sometimes the row below throws the exception below.
New ExcelQueryFactory(FileFullPath)

Can't reproduce it, but it pops up now and then on the live server.

LinqToExcel Version 1.6.2.0
MS Server 2008 R2

System.Web.HttpUnhandledException (0x80004005): Exception of type 
'System.Web.HttpUnhandledException' was thrown. ---> 
System.Data.OleDb.OleDbException (0x80004005): IErrorInfo.GetDescription failed 
with E_FAIL(0x80004005).
   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
   at LinqToExcel.Query.ExcelUtilities.GetWorksheetNames(ExcelQueryArgs args)
   at LinqToExcel.Query.ExcelUtilities.GetWorksheetNames(String fileName)
   at LinqToExcel.Query.ExcelQueryExecutor.GetWorksheetName()
   at LinqToExcel.Query.ExcelQueryExecutor..ctor(ExcelQueryArgs args)
   at LinqToExcel.ExcelQueryFactory.WorksheetNoHeader(Int32 worksheetIndex)
   at Paloma.Classes.Importing.ExcelImportFileConverter.GetImportDataAsDataTable() in C:\__svn\Release-3.3.x\Members\Classes\Importing\ExcelImportFileConverter.vb:line 15
   at Paloma.AddressListsAddSubscribers.ImportFromExcel(Int32 intCustomerId, Int32 intAddressListId) in C:\__svn\Release-3.3.x\Members\AddressListsAddSubscribers.aspx.vb:line 242
   at Paloma.AddressListsAddSubscribers.lbtnSaveSubscriber_Click(Object sender, EventArgs e) in C:\__svn\Release-3.3.x\Members\AddressListsAddSubscribers.aspx.vb:line 215
   at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
   at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.addresslistsaddsubscribers_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Namespace Classes.Importing
    <Serializable()> _
    Public Class ExcelImportFileConverter
        Inherits ImportFileConverter

        Public Sub New(ByVal fileFullPath As String)
            MyBase.New(fileFullPath)
        End Sub

        Public Overrides Function GetImportDataAsDataTable() As DataTable
            Dim dataTable = New DataTable
            dataTable.BeginLoadData()
            Try
                Dim excelFile = New ExcelQueryFactory(FileFullPath)
                For Each importDataRow In excelFile.WorksheetNoHeader(0)
                    If dataTable.Columns.Count = 0 Then
                        For i = 1 To importDataRow.Count
                            dataTable.Columns.Add(New DataColumn())
                        Next
                    End If
                    Dim dataRow = dataTable.NewRow
                    dataRow.ItemArray = importDataRow.ToArray
                    dataTable.Rows.Add(dataRow)
                Next
            Finally
                dataTable.EndLoadData()
            End Try
            Return dataTable
        End Function
    End Class
End Namespace

Original issue reported on code.google.com by carl.bjo...@gmail.com on 26 Jun 2012 at 11:44

GoogleCodeExporter commented 8 years ago
I've never seen this error before. It seems to be something with OLEDB and not 
LinqToExcel.

And since it can't be reproduced there is nothing I can do. Sorry.

Original comment by paulyo...@gmail.com on 26 Jun 2012 at 1:23