Solved

MYSQL V4 - VB.NET Connection

Posted on 2010-09-08
1
303 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
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now