views:

76

answers:

2

I'm currently using ODBC to connect to my MySQL database, using C#. I've been told that using the MySql Connector would be better, and faster, and not dependent on Windows. Can someone shed some light on this please? I've been unable to find anything on the net so far

+3  A: 

I'm not sure what you are asking for tbh. But ODBC is a generic provider while the mysql provider is specific for mysql db. Therefore the specific provider could be more optimized towards mysql and preform better. Both ODBC and the mysql provider is available for mono (linux, unix) and .net (windows) but it's always recommended to use the specific provider if there is one.

Mattias Jakobsson
Thanks. I was just wondering if there was some massive flaw with ODBC that I was unaware of..
Matt
A: 

Write a test application (well, two applications, I suppose - one for ODBC and one for MySql Connector) and measure the performance difference. Make sure you flush caches/burn incense/sacrifice to the god or gods of your choice/etc (don't know if this is possible/necessary on MySql) between runs. In the past I've done this (minus the incense and sacrifices, so results may have been inadvertently skewed) with other database access tools and found that ODBC added runtime overhead ranging from 5% on simple, quick queries to effectively no overhead on complex, long-running queries. YMMV.

Share and enjoy.

Bob Jarvis