Problem with OleDbConnection, Excel and connection pool

So, I have the same symptoms as described in C # / ASP.NET Oledb - reading MS Excel "Unspecified error" , but my answer didn’t seem to fix it. Even always closing OleDBConnection and removing from it show the same symptoms.

var connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0; data source={0}; Extended Properties=Excel 12.0;", _excelFile);
using (var conn = new OleDbConnection(connectionString))
{
    try
    {
        DoSomething();
    }
    finally
    {
        conn.Close();
    }
}

Now I found the following connection pool information:

The .NET Framework Data Provider for OLE DB automatically merges connections using the OLE DB connection pool. Connection string arguments can be used to enable or disable OLE DB services, including federation. For example, the following connection string disables the OLE DB connection pool and automatic transaction transfer.

Provider = SQLOLEDB; OLE DB Services = -4; = localhost; Integrated Security = SSPI;

, , . , , . , , , , , .

(: http://msdn.microsoft.com/en-us/library/ms254502.aspx)

OLE DB SERVICES -4?

+2
2

, , OLE DB Services=-4.

, . , . DBPROPVAL_OS_AGR_AFTERSESSION, 8 (. Oledb.h).

+4
0

All Articles