It's old code written for educational purposes and probably for ADO.NET
1.1 - which did not have DbProviderFactory.
1) the article is dated 2 years after .NET with DbProviderFactory
was released
2) even in .NET 1.x the code was crap, because:
- IDbConnection CreateCommand already existed
- the IDbConnection could be constructed using reflection
3) especially for educational purposes things should be done
the right way
The author is/was an MVP with several books to his name. Are you saying
he can't code? ;-)
Apparently he is clueless about how to write database independent
code in .NET and even from a pure OO perspective the code does not
look good (an important aspect of good OO is putting characteristics
in the types and utilizing polymorphism and avoid switch on type).
He may be an excellent ASP/VBS programmer. I have no idea of
knowing.
Arne