Click here to Skip to main content
14,972,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i get the option not supported error when i run my code on the mysqlconnection line:

Private DBCon As New MySqlConnection("database=database;Server=server name;uid=user name;pwd=password")
Private DBCmd As MySqlCommand

'DB DATA 
Public DBDA As MySqlDataAdapter
Public DBDT As DataTable

'QUERY PARAMERTS
Public params As New List(Of MySqlParameter)

' QUERY STATISTICS
Public RecordCount As Integer
Public Exception As String

' ALLOW CONNECTION STRING OVERRIDE
Public Sub New(ConnectionString As String)
    DBCon = New MySqlConnection(ConnectionString)
End Sub


What I have tried:

iver tried using different keywords and not using =
Posted
Updated 10-Mar-21 23:53pm

1 solution

I'd suggest to download ADO.NET connector[^], then to read this: MySQL :: MySQL Connector/NET Developer Guide :: 4.1 Creating a Connector/NET Connection String[^]

VB.NET
Dim conn As New MySql.Data.MySqlClient.MySqlConnection
Dim myConnectionString as String

myConnectionString = "server=127.0.0.1;" _
            & "uid=root;" _
            & "pwd=12345;" _
            & "database=test"

Try
  conn.ConnectionString = myConnectionString
  conn.Open()

Catch ex As MySql.Data.MySqlClient.MySqlException
  MessageBox.Show(ex.Message)
End Try
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900