We help IT Professionals succeed at work.

VC++ How to connect MYSQL net connector without CLR support

star90
star90 used Ask the Experts™
on
Hi,
I am using VC++
I am trying to use the Versant object database which for some reason I have linking errors when using the CLR support.
I also have access in the same program to MYSQL using net connector with CLR support.
So I was thinking to give up the CLR support and try to use the Versant Object database and MYSQL without the CLR support:
but it seems that in order to add the reference: MySQL.Data.dll  to the project
 I need the CLR support, otherwise if the project is not a CLR project there is no option of "browse" to add the file MySQL.Data.dll

Does anyone have a solution for this?
Is it possible to use the net connector without CLR support?
Which other options do I have?

Thanks!
-----------------------------------------------------------------------------
the connector location:
C:\Program Files (x86)\MySQL\MySQL Connector Net 6.2.4\Assemblies
the commands I am using are:
using namespace System;
using namespace System::Data;
 
using namespace MySql::Data::MySqlClient;
using namespace std;
//
MySqlConnection ^conn = gcnew MySqlConnection("Server=localhost;Database=test;Uid=root;Pwd=abc;Port=3306;");

conn->Open();

MySqlCommand ^cmd = gcnew MySqlCommand();
cmd->Connection = conn;
cmd->CommandType = System::Data::CommandType::Text;
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You could use ODBC but people say it is slower.  http://www.mysql.com/products/connector/

Author

Commented:
Hi DaveBaldwin,
Thank you for the answer,
Assuming I use the ODBC, Is there an easy way to convert from the net connector syntax to the ODBC syntax?
Thanks
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
I don't know, I've just used ODBC with ASP and ASP.NET web pages.  I see there is also a C++ connector on that web page.  Is that the one that you are using?

Author

Commented:
I am using currently the net connector which I find it easy to use.
Il am not sure if to use the ODBC or the C++ or the C connector.
Fixer of Problems
Most Valuable Expert 2014
Commented:
I think .NET implies CLR.  At least take a look at the C++ version and see what's there.