Page 1 of 1

importing corelabs.mysql namespace

Posted: Thu 20 Jul 2006 15:11
by jcrabtreesla
I am very new to MYSQL. My company has purchased your MySQL.net program. I have a newbie question.

First, I have installed the software correctly and I am able to view the database in the Solution Explorer (VS 2005 Pro) and also the DB explorer. I am able to add tables, etc. I have been able to create a basic adapter and datatable object through the wizards in VS 2005.

What I want to do is create my own custom dataReader object. In the past I have used SQL and to accomplish this you must import system.data.sqlclient to be able to access the dataReader object along with the proper sqlconnection and sqlcommand objects. I have tried to replicate my old methods using this sqlclient, but I have run into numerous problems.

I think I have figured out that I need to add the correct MySQL namespace using an import. I have seen it used on other forum posts as imports CoreLabs.MySQL (or some very similar syntax). When I tried to do the same, the intellesense gave me no such options.

My question is how do I get that namespace into my project? I am pretty sure that is my problem, but if someone has other suggestions, please let me know. I can provide sample code if you need, but I think my code would be solid if I have the right namespace imported.

Thanks for helping a newbie

Posted: Thu 20 Jul 2006 15:20
by Alexey
If you have MySqlConnection component on your form add this string to the code (assuming you are using VB):

Code: Select all

Imports CoreLab.MySql
otherwise add our assembly to your project first.

Posted: Thu 20 Jul 2006 15:38
by jcrabtreesla
Thanks, but that is my problem. I can't add "imports CoreLab.MySQL". Maybe I don't have something installed properly? How do I add your assembly to my project? That might be my problem. Thanks

Posted: Thu 20 Jul 2006 18:40
by jcrabtreesla
Success!

I found you need to add a reference to the assembly files.

Right Click on the project in the solution explorer
Select Add Reference
Add all CoreLabs MySQL assemblies

Posted: Fri 21 Jul 2006 06:10
by Alexey
As i told you if you have MySqlConnection component on your form you do not have to add our assembly because it is added automatically for you.