|
-
Oct 4th, 2014, 08:21 PM
#1
Thread Starter
Addicted Member
How do I add MySql reference?
Hey guys, so a while ago I made a project in VB and made some MySQL connections to get some data and such however now I completely wiped my computer and want to add MySQL Conneciton and all the functions for MySQL but it's not in my .NET or COM references?
Can someone please help me?
-
Oct 4th, 2014, 08:41 PM
#2
Re: How do I add MySql reference?
You have to download Connector/Net from MySQL and install it.
-
Oct 4th, 2014, 09:22 PM
#3
Thread Starter
Addicted Member
Re: How do I add MySql reference?
 Originally Posted by jmcilhinney
You have to download Connector/Net from MySQL and install it.
Yeah I downloaded and installed it here
http://dev.mysql.com/downloads/file.php?id=454041
IS this not the correct installer for the MySql connector?
-
Oct 4th, 2014, 09:45 PM
#4
Re: How do I add MySql reference?
That is indeed the correct library. Once that's installed, you should be able to reference MySql.Data.dll in your projects. That library should be added from under Assemblies -> Extensions in the Reference Manager dialogue. Note that Connector/Net alone will only allow you to add that reference and write your own ADO.NET code. If you want VS integration then note this:
Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/...r-windows.html).
-
Oct 4th, 2014, 09:49 PM
#5
Thread Starter
Addicted Member
Re: How do I add MySql reference?
 Originally Posted by jmcilhinney
That is indeed the correct library. Once that's installed, you should be able to reference MySql.Data.dll in your projects. That library should be added from under Assemblies -> Extensions in the Reference Manager dialogue. Note that Connector/Net alone will only allow you to add that reference and write your own ADO.NET code. If you want VS integration then note this:
I keep trying to do this:
Program -> Add Reference -> .NET -> MySQL.Data
and Click ok and it's still giving me the unidentified error for these:
MySqlConnection
MySqlCommand
MySqlDataReader
-
Oct 4th, 2014, 10:02 PM
#6
Re: How do I add MySql reference?
 Originally Posted by therehere3
I keep trying to do this:
Program -> Add Reference -> .NET -> MySQL.Data
and Click ok and it's still giving me the unidentified error for these:
MySqlConnection
MySqlCommand
MySqlDataReader
Adding a reference to an assembly gives you access to the types defined in that assembly. You still have to name them properly though. The fully qualified names are MySql.Data.MySqlClient.MySqlConnection, MySql.Data.MySqlClient.MySqlCommand and MySql.Data.MySqlClient.MySqlDataReader. Like all types, you have to either use their fully qualified names or else import the namespace that they're a member of, i.e. MySql.Data.MySqlClient. You can import the namespace at the file level or at the project level, on the same References page of the project properties that manages references.
-
Oct 4th, 2014, 11:25 PM
#7
Thread Starter
Addicted Member
Re: How do I add MySql reference?
 Originally Posted by jmcilhinney
Adding a reference to an assembly gives you access to the types defined in that assembly. You still have to name them properly though. The fully qualified names are MySql.Data.MySqlClient.MySqlConnection, MySql.Data.MySqlClient.MySqlCommand and MySql.Data.MySqlClient.MySqlDataReader. Like all types, you have to either use their fully qualified names or else import the namespace that they're a member of, i.e. MySql.Data.MySqlClient. You can import the namespace at the file level or at the project level, on the same References page of the project properties that manages references.
Yeah man I am not seeing why it's giving this stupid error....
I have the reference MySql.Data and I used the import on the top of the code as this:
Imports MySql.Data.MySqlClient
and even tried this
Imports MySql.Data
Nothing is working... I am not sure what I am doing wrong here.
-
Oct 4th, 2014, 11:33 PM
#8
Re: How do I add MySql reference?
What happens if you type this:
Code:
Dim obj As MySql.Data.MySqlClient.
What options does Intellisense show you when you type the last dot?
-
Oct 5th, 2014, 02:01 AM
#9
Thread Starter
Addicted Member
Re: How do I add MySql reference?
 Originally Posted by jmcilhinney
What happens if you type this:
Code:
Dim obj As MySql.Data.MySqlClient.
What options does Intellisense show you when you type the last dot?
I'm not that retarded :P
If I start typing the "My" from MySql nothing happens in the Intellisence even then.
So again it's all not defined it says.
-
Oct 5th, 2014, 03:15 AM
#10
Re: How do I add MySql reference?
Noone said that you were retarded. We're not sitting in front of your computer seeing what you're seeing so we can either guess or ask you for information.
Have you looked in the Object Browser to see what's available there? In fact, maybe post a screenshot of the References page of your project properties showing both the MySQL reference and namespace import, plus a screenshot of your Object Browser with any relevant MySQL nodes expanded.
-
Oct 5th, 2014, 03:34 AM
#11
Thread Starter
Addicted Member
Re: How do I add MySql reference?
 Originally Posted by jmcilhinney
Noone said that you were retarded. We're not sitting in front of your computer seeing what you're seeing so we can either guess or ask you for information.
Have you looked in the Object Browser to see what's available there? In fact, maybe post a screenshot of the References page of your project properties showing both the MySQL reference and namespace import, plus a screenshot of your Object Browser with any relevant MySQL nodes expanded.
Awwhh got it now.
Under my References it said the MySql was at version 0.0.0.0 so obviously some problem went wrong.
Removed it and added it back in and works fine now.
Thanks.
-
Oct 5th, 2014, 03:36 AM
#12
Re: How do I add MySql reference?
 Originally Posted by therehere3
Awwhh got it now.
Under my References it said the MySql was at version 0.0.0.0 so obviously some problem went wrong.
Removed it and added it back in and works fine now.
Thanks.
Damn! What a retard! Only kidding.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|