But have you also added a reference to the ? In this case if you are sure that you have installed the MySql connector then simply choose add reference, on the dialog box shown choose browse then navigate to the folder inwhich it is installed in my case it is C:\Program Files (x86)\MySQL\Connector NET 6.10\Assemblies\v4.5.2 then select click on open then add and it should work alright Sometimes adding the refernce to becomes problematic if it is not listed in the reference tab of your project's prpoerties. I have fixed it by adding the reference from the older version that is V2.0 instead of V4.5.
, and a reference to the I got 'MySqlConnection is not defined'. Smtp_client.DeliveryMethod = SmtpDeliveryMethod.Network Public Function check(ByVal datereceived As String, ByVal shipdate As String, ByVal partsn As String)ĭim con As String = ConfigurationManager.ConnectionStrings("xxxConnectionString").ConnectionStringĭim theQuery2 As String = "SELECT Max(shipmentdate) FROM prc.tbsrparts t WHERE Substring(partsn, 17, 11) = '" + partsn.ToString + "'" 'get latest shipment date from databaseĭim command2 As New MySqlCommand(theQuery2, Sql)
My error is showing ->BC30002: Type 'MySqlConnection' is not defined.
#Eagetmail reference add in vb net code#
Type 'MySqlConnection' is not defined I am facing the error on the below code while i created a function call class at app_code. MessageBox.Show("Cannot connect to database: " & ex.Message) If Not db_con Is Nothing Then db_con.Close()ĭb_con.ConnectionString = String.Format("server= pooling=false", db_host, db_username, db_password, db_name)Ĭonsole.WriteLine("Connected to server " + db_host)ĭim Requete As String = "UPDATE client SET nom_client ='client unknown' WHERE nom_client is null"Ĭommande = New MySqlCommand(Requete, Connexion)Ĭonsole.WriteLine("there was " & Commande.ExecuteNonQuery() & " lines changed")Ĭonsole.WriteLine("Disconnected from server " + db_host) This is the code : (it's a class called ConnectDateBase.vb.) MySqlConnection' is ambiguous in the namespace ' - mysql I'm trying to make a connection to a database on localhost but I have a problem.