List of DB drivers.

  • Thread starter Thread starter Mr. X.
  • Start date Start date
Arne said:
Hopefully not.

That code sucks big time.

It's old code written for educational purposes and probably for ADO.NET
1.1 - which did not have DbProviderFactory.

The author is/was an MVP with several books to his name. Are you saying
he can't code? ;-)
 
Thanks ...
As your example, I did :
DbProviderFactory dbf =
DbProviderFactories.GetFactory("MySQL.Data.MySQLClient");

But the above throws an exception :
Unable to find the requested .Net Framework Data Provider. It may not be
installed.
Why is the above exception?

Thanks :)
 
Sorry. Problem solved.
The provider name is case sensitive.
Changed to :
MySql.Data.MySqlClient
Works !!!

Thanks, anyway :)
 

Yes.

"ADO.NET Driver for MySQL (Connector/NET)"
Also, is the provider I pass to DbProviderFactory the same name as the
files included :
I.e for mysql : "MySql.Data" ?
How can I know the exact provider name I pass to DbProviderFactory?

Thee argument is the invariant attribute in the entry
in DbProviderFactories in the config file.

Usually it is the same as the namespace of the provider.

Arne
 
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
 
Back
Top