SQL DMO and SQL SMO with .NET application

Wednesday, February 3, 2010 |

Recently I was assigned one project for optimization which has been developed in windows .net 2.0 environments with C# language. Along with optimization I have to move database from SQL Server 2005 to SQL Server 2008.

When I configured that application in my server, I used to get following error:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {10020100-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80040154

That application was working fine on my client’s server and showing me error in my server so I looked at the code in debug mode and found when the application is trying to open connection form SQL DMO, connect don’t get open and showing the above error.

When I observed that I brush up my memory and remember that SQL DMO is older version, used to use with SQL Server 2000 and it was there in SQL Server 2005 too for backward compatibility. The server I was using to test that application had just SQL Server 2008 and this issue start raising.

Now I have two choices.
1.)    Change complete code to SQL SMO from SQL DMO as SQL DMO is older version and deprecated in newer SQL Server
2.)    Use backward compatibility tool which used to ship with SQL Server 2005

First choice is fair but since I am testing I can’t go for that as of now so I choose second way and downloaded component from following link and error got disappeared.

There are so many different downloaded on above link, you have to go for following section:

Microsoft SQL Server 2005 Backward Compatibility Components

Reference: Ritesh Shah
http://www.sqlhub.com
Note: Microsoft Books online is a default reference of all articles but examples and explanations prepared by Ritesh Shah, founder of
http://www.SQLHub.com

0 comments: