Solved

MYSQL V4 - VB.NET Connection

Posted on 2010-09-08
1
311 Views
Last Modified: 2012-05-10
Hi,

I am writing a small (but urgent) application with VB.NET in visual studio V2005 trying to connect to a MYSQL V4 database which is hosted on a Windows 2003 server.

I have used the MYSQL Connector Net v5.1.0.0 as this version connects to the v4 MYSQL Database, and the application connects without problem on my development machine.

However I cannot get this MYSQL NET connector to install on the windows server (MSI fails saying that it can not complete) - any have given up hope of getting this method to work- I can not install the latest MYSQL net connector as it does not support MYSQL V4 (or so I believe)

Therefore is there any other method of connecting that I can use?

Below is a section of the existing code (hard coded connection string is for testing purposes only) and I do add the reference to the mysql data file.

Can anyone please take my code and show me anyother way of connecting and what files / references I will need to add or install on the machine hosting the application.

Many thanks

------------------
Imports MySql.Data
Imports MySql.Data.MySqlClient

Module Daily_Report

    Sub Main()

        ' ########################################################
        ' #              Create Database Connections             #
        ' ########################################################

        Dim DBconnectString As String

        Dim DBconnection1 As New MySqlConnection
        Dim DBsqlstatement1 As String
        Dim DBsqlcommand1 As New MySqlCommand
        Dim DBsqlreader1 As MySqlDataReader

        ' ########################################################
        ' #              Connection to Database    #
        ' ########################################################

        DBconnectString = "server=10.10.1.3;user=testuser;database=sdata;port=5002;password=testing"
        DBconnection1 = New MySqlConnection(DBconnectString)
        DBconnection1.Open()

        DBsqlstatement1 = "select company_id, company name from daily_customer_report"
        DBsqlcommand1 = New MySqlCommand(DBsqlstatement1, DBconnection1)
        DBsqlreader1 = DBsqlcommand1.ExecuteReader()

        While (DBsqlreader1.Read())
        ................etc............etc.............


0
Comment
Question by:Dan560
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 33634035
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question