MySQL Connection menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Connection

    How do i make a mySql Connection in VB 2008? I am working on a program that is a DB editor in VB and I know it is possible. Ive tried googling it and i didnt get anything good. Any help?

    MySQL Connection
  2. #2
    epic_'s Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exact snippet from one of my programs :P

    Code:
            Try
                Using conn As New MySqlConnection(GetConnectionInfo())
                    conn.Open()
    
                    If conn IsNot Nothing Then
                        If conn.State = ConnectionState.Open Then
                            conn.Close()
                        End If
                    End If
                End Using
                'MessageBox.Show("Your credentials have been verified, transferring now!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
    
            Catch sqlerror As MySqlException
                MessageBox.Show(sqlerror.Message, "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Exit Sub
                'Throw new Exception("An error occured while logging into the SQL server.", sqlerror); 
            End Try
    
            FrmMain.Show()
            Me.Close()
    Then add the function
    Code:
    Public Function GetConnectionInfo() As String
            Return ("Data Source=" + TxtHost.Text + ";uid=" + TxtUsername.Text + ";pwd=" + TxtPassword.Text + ";database=" + TxtWorld.Text + ";")
        End Function
    Of course you need to edit the code for your uses. OR you could google it :P http://www.google.com/search?hl=en&q...sql+connection
    Last edited by Clain; 01-02-2009 at 05:23 PM.

  4. #4
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Clain = Pure Win

    +Rep for You

    EDIT: Gotta Spread

  5. #5
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also how can you make it so that the program refrences libmysql.dll so it know all the stuff?

  6. #6
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh... sorry forgot the references... Add "Mysql.Data.dll" to your project. You don't use libmysql.dll for this. Google Mysql.Data.Dll to DL it

  7. #7
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Clain i have to say you are pure win

Similar Threads

  1. [How-To] MySQL Connection and DataGridView in VB.NET
    By EmiloZ in forum Programming
    Replies: 4
    Last Post: 04-14-2013, 07:29 PM
  2. How to set up a Remote MYSql Connection
    By SupernovaHH in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 07-21-2009, 11:47 PM
  3. MySQL connection error
    By Trueno92 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 04-17-2009, 03:01 PM
  4. Problem With MySQL Connection
    By omarer in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-07-2007, 01:02 AM
  5. Cannot connect to MySQL Database
    By awa5523 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-06-2007, 03:59 PM
All times are GMT -5. The time now is 03:43 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search