Connect to MYSQL with VB.NET - mysql

I am trying to connect to a MYSQL database using VB.NET to handle some simple tasks at a page level. Usually the connections are made to a MYSQL database. I have downloaded a MYSQL-CONNECTOR 6.0.7. How do I reference or add this to my web project so that I can create the connection and use the provided methods?
In the unzipped package I download I do not see any dll files so not sure what to do with this ATM, I am used to seeing a bin folder which contains this. Maybe I have a bad download any suggestions?

If you downloaded the ZIP archive, then generally this is the source code distribution. You need to open MySQLClient.sln in Visual Studio and build the MySql.Data project to produce MySql.Data.dll in the bin folder.

the last version is 6.4.3 download from http://www.mysql.com/downloads/connector/net/ , add reference for the unzip folder and us it as sqlClient it has the same class only have to append My to the class name

Related

Delphi 2010, Connect to mySQL and Firebird database without lib dlls

I am writing a portable application that connects to both a firebird database and a mysql database. I am writing the application in Delphi 2010, and using dbExpress components to connect to both databases. SQLconnection component uses dbxmys.dll and libmysql.dll for the mysql database, and dbxfb.dll and fbclient.dll for the firebird database.
On my development computer I had to move the dll files into /windows/system/. I think this is because of the system paths, in order to find the correct files and connect. I tried this on another client machine, and the software could not connect because the dll files were not found. Because this is a portable application I do not want to include a sub directory of the application directory to include the dll files, however I do not think the a client machine can run the applicaiton without having mySQL and Firebird installed and the pathing set correctly.
Is there a better way to do this? I have concidered making a sub directory and forcing my application to look there, (since firebird and mySQL can be installed anywhere) if they were included I would know for sure were they were at on any computer my app is launched from. But I don't really want to take this approach.
What are my options as far as direct db connection, or solving the dll requirement problem, I am not an experienced software developer. Thanks in advance.
Update:
The DLLs are now in the same directory with the exe, and the application launches fine. I Still do not want to use any dlls. I have found a few components that do not require dlls, but they also require payment, finding another free option would be ideal.
What you can do is to store the .dll within the main .exe as zipped resources, then expand them in a local folder (local "Application data" for instance), and execute the library from there. Therefore, you do not need to put files in the system path (probably with administrator rights), nor change the path itself.
As a result, you do not need to copy the .dll with the .exe, and if the .dll are already available, your application will use them. The .exe folder won't be "polluted" by the library files, and your software could be still self-installing: if you copy the .exe in another computer, you still have the .dll within it, ready to be installed in an hidden local folder.
This is for instance how our SynProject tool use Hunspell libraries for spell checking. See this SO answer.

Installing mysql.data.mysqlclient using mysql connector but no bin folder?

I would like to connect to our remote mysql db using VB.NET but I'm having issues with installing a .dll file. I need to add mysql.data.mysqlclient reference but can't find bin folder containing .dll file. I did many google and stack overflow searches but haven't stumbled on any solutions.
I downloaded mysql connector
Unzipped it
Opened Visual Studio 2010 Express and created new project
Under solutions explorer, right clicked to add reference
Then browsed to unzipped mysql connector folder to find bin folder
This bin folder isn't anywhere to be found. I'm missing something, any help is appreciated.
You have to install the mysql connector to your machine. Then open your project, right click, and click 'add reference', find 'mysql.data' at the '.NET' tab.

Visual Studio Windows Installer with MYSQL check and Install

I have a VB Windows forms application that uses a mysql database to keep track of everything within the application.. The problem that I know will occur is that most of the applications users will not have MYSQL let alone know how to install it properly... To install the application on the users systems I am using the Visual Studio Setup Installer to handle creation of the msi files.. What needs to happen first is the installer needs to check to see if MYSQL is installed on the host system and verify server name.. If true then import database, if not then install followed by import database... The importing is not the issue here... How do I make the installer install mysql with controlled parameters such as server name, etc, etc. Any ideas on this??? I have hammered google for the past 3 hours looking for bread crumbs on this but to no avail...
Usually existing packages (like the MySQL installer) are added as prerequisites. Visual Studio setup projects do not support custom prerequisite creation. However, this can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
You can then select the prerequisite in your setup project properties page.
Well... that's a good question. The first thing that pops up in my mind:
You could build the check in your application instead of the installer and warn the user about it. If needed, you could provide another installer to make sure everything is available (MySQL and the database itself).
I hope it helps you further.
Yours sincerely,
Roland

How to Integrate MYSql in C# Setup Project?

I want to install MySql and Database File while installing the Setup File,
which is developed in C#.
simply, while installing the setup file only everything needs to be installed
(MYSql,Database File)
So, please guide me on this.
You can set Custom Launch Options to the Setup file. Add the necessary executibles in the Commit node of the setup file and those will get executed when your installation finishes.
As for installing entire MySQL, you would need to add the installation files of MySQL to the Setup project. Executing the Database Script would be simple, just call the script after MySQL installs.

create and restore a mysql db using a setup project (installer) in VS.Net

What is the best practice for creating an installer for a winform application.
The application is supposed to install the following without connecting to internet.
.Net Framework 3.5sp1
MySQL Server
My SQL Connector
Restore Mysql db
Update Config file with the MySQL uname/pwd.
I have all the msi files for installing the above mentioned items. But am wondering about the best practice to create the installer.
Thanks in advance,
Hi I came up with a similar situation. Firstly you should have .NET framework offline installer which can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=992cffcb-f8ce-41d9-8bd6-31f3e216285c. I assume you are using visual studio installer. There are couple of choices but I prefer to copy the offline .NET installer to the setup projects output directory and from requirements on target machine tab I set the install URL property of .NET framework the exact name of offline setup file. As described in the figure.
So the installer does not try to connect to a remote computer to download .NET framework and install it however I think it is more appropriate that it connects to a Microsoft server and installs it. Anyways the next step is to configure the MySQL server. MySQL is really generous for me since they support a fully documented noinstall files. You can find the document here: http://dev.mysql.com/doc/refman/5.5/en/windows-install-archive.html
Using a noinstall zip archive you can copy the dbengine core files to any folder on the clint machine. And change the configuration parameters of MySQL. You can name the MySQL service anything you want. Start the the service and create tables. You can do all of this stuff from custom actions tab of the setup project choosing the appropriate script files or you can write code for it. The beautiful thing is that your customer does not need to know that he/she is installing a database engine on the target machine. I hope this helps. Thanks.