Wednesday, February 21, 2018

0x80029C4A - 000208D5-0000-0000-C000-000000000046 0 TYPE_E_CANTLOADLIBRARY - How to fix

Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Repair Office from Control Panel and it should resolve the issue.

Looks like it's often caused by an Office update.

Thursday, December 04, 2014

TTransportException SocketTimeoutException - Hive - Azure HDInsight Emulator

While working on Hive in Azure HDInsight Emulator I was not able to create database and following exception was being thrown with all the queries:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: org.apache.thrift.transport.

To resolve the issue and assuming Hadoop installation folder is C:\hdp open hive-site.xml from:
C:\hdp\hive-....*\conf directory


  Driver class name for a JDBC metastore

and change CommonDriver to EmbeddedDriver:

  Driver class name for a JDBC metastore

From Services restart Apache Hadoop Metastore service and retry running HQL queries. It should work not. In case issue cannot be resolved feel free to drop me an email or comment.

Thursday, July 03, 2014

ODP.NET Managed Data Access (Oracle.ManagedDataAccess.dll) with Enterprise Library

Oracle.ManagedDataAccess.dll is managed Oracle connector that doesn't require any Instant Client to be installed and offers advantage over unmanaged counterparts. It doesn't require any installation on the machine and Oracle.ManagedDataAccess.dll should be placed in execution directory or in probing directory specified in configuration.

Below are the two errors which you may receive while trying to use Oracle Managed Data Access DLL:

1. Activation error occured while trying to get instance of type Database, key ""

Resolution of the dependency failed, type = Microsoft.Practices.EnterpriseLibrary.Data.Database, name = ConnectionString.
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.-----------------------------------------------
At the time of the exception, the container was: Resolving  Microsoft.Practices.EnterpriseLibrary.Data.Database,ConnectionString (this occurs when wrong provider factory is used or DbProviderFactories hasn't been added to the application configuration or machine.config)

2. Configuration system failed to initialize (this occurs when configuration section doesn't have correct entry)

To make Oracle.ManagedDataAccess.dll work with Enterprise Library few additional obvious configuration changes are required:

 Add configSections section at the top of configuration:
<configSections> <section name="oracleConnectionSettings" type="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.Configuration.OracleConnectionSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/> <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </configSections>

Add Db Provider Factories:

In case of ODP.NET to load appropriate factory while creating database machine.config is modified during installation and DbProviderFactories is added however with Oracle.ManagedDataAccess.dll there is no installation required so edit the application configuration file (app.config or web.config) and add following:
<> <DbProviderFactories> <remove invariant="Oracle.ManagedDataAccess" /> <add name="Oracle Managed Data Provider for .NET" invariant="Oracle.ManagedDataAccess" description="Oracle Managed Data Provider for .NET" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </DbProviderFactories> </>

Make sure to change the version and Public Key Token depending on the version being used.

Connection string for EZConnect looks like:
<connectionStrings> <add name="ConnectionString" connectionString="Data Source=//localhost:1521/Shash;User ID=scott;Password=tiger;" providerName="Oracle.ManagedDataAccess" /> </connectionStrings>

Above configuration changes allow use of Oracle.ManagedDataAccess.dll with Enterprise Library.

Monday, September 30, 2013

Calling LoadLibraryEx on ISAPI filter "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" failed

Installed .NET Framework 1.1 for Driver caused TDoD Service to stop with error - Calling LoadLibraryEx on ISAPI filter "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" failed.

To fix the error remove ISAPI extension from ISAPI filters added in website by .NET Fx 1.1 installer.

Tuesday, July 16, 2013

Python Libraries For Scraping

List of python scraping libraries I use to develop crawlers based on my choice of scraping library:
  1. No other than - SCRAPY - fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing
  2. UrlLib2 + Beautiful Soup - If I had to build framework from scratch this is the first choice
  3. Mechanize + Beautiful Soup - Replace UrlLib2 with Mechanize - Easy HTML form filling, any URL can be opened, not just HTTP, Automatic handling of HTTP-Equiv and Refresh, Easy link parsing and following
Please leave a feedback if you are using some other library that I should list here.

BeClasp Consulting provides Python and .NET based website scraping service and have wrote 1000's of parsers so far ranging from data crawling for Bank Accounts reconciliation, e-commerce stores or other data mining services. Drop us an email at to know more about the services we offer.

Wednesday, May 01, 2013

Outsource .NET Development

Are you exploring the possibilities to outsource your next .NET application? Beclasp Consulting offers a dedicated Offshore .NET Developers team to provide you best in class results through Microsoft Certified Developers. To know more please visit:

Thursday, May 17, 2012

The 'DbProviderFactories' section can only appear once per config file

Open machine.config at:

Locate section:
<!-- providers added here -->
<add name="... />

Line to be removed to resolve the issue

Tuesday, April 17, 2012

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format

Solution: In IIS Set 'Enable 32bit Applications' to True for the application pool used in the site.

If you are using ODP.NET in 64bit machine and have installed ODP.NET 32bit version you may get the error:

'Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format'

To resolve the issue:
  • Select application pool that is getting used in the site.
  • Click on Advanced Settings...
  • Enable 32-Bit Applications - True
  • OK
  • You are done!

Monday, January 30, 2012

SQL Server 2012 (Denali): OFFSET and FETCH Limitations

OFFSET and FETCH can be used in any query that allows TOP and ORDER BY with the following limitations:
  1. The OVER clause does not support OFFSET and FETCH.
  2. OFFSET and FETCH cannot be specified directly in INSERT, UPDATE, MERGE, and DELETE statements, but can be specified in a subquery defined in these statements. For example, in the INSERT INTO SELECT statement, OFFSET and FETCH can be specified in the SELECT statement.
  3. In a query that uses UNION, EXCEPT or INTERSECT operators, OFFSET and FETCH can only be specified in the final query that specifies the order of the query results.
  4. TOP cannot be combined with OFFSET and FETCH in the same query expression (in the same query scope).

SQL Server 2012 (Denali) New Features: Limit number of rows using OFFSET and FETCH clause

Limiting the number of rows returned

The following example specifies an integer constant as the value for the OFFSET and FETCH clauses. The first query returns all rows sorted by the column ID. Compare the results returned by this query with the results of the two queries that follow it. The next query uses the clause OFFSET 5 ROWS to skip the first 5 rows and return all remaining rows. The final query uses the clause OFFSET 0 ROWS to start with the first row and then uses FETCH NEXT 10 ROWS ONLY to limit the rows returned to 10 rows from the sorted result set.

-- Return all rows sorted by the column DepartmentID.
SELECT ID, Name, GroupName
FROM Department

-- Skip the first 5 rows from the sorted result set and return all remaining rows.
SELECT ID, Name, GroupName
FROM Department

-- Skip 0 rows and return only the first 10 rows from the sorted result set.
SELECT ID, Name, GroupName
FROM Department