I am facing the error on the below code while i created a function call class at app\_code.

My error is showing -->BC30002: Type 'MySqlConnection' is not defined. Please help.Thanks!

```
Imports System.Data
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports MySql.Data.MySqlClient

Namespace check90daysreturn

Public Class Check90days
    Public Function check(ByVal datereceived As String, ByVal shipdate As String, ByVal partsn As String)

        Dim con As String = ConfigurationManager.ConnectionStrings("xxxConnectionString").ConnectionString
        Dim Sql As New MySqlConnection(con)

        Dim reader2 As Object
        Dim theQuery2 As String = "SELECT Max(shipmentdate) FROM prc.tbsrparts t WHERE Substring(partsn, 17, 11) = '" + partsn.ToString + "'" 'get latest shipment date from database
        Dim command2 As New MySqlCommand(theQuery2, Sql)
        reader2 = command2.ExecuteScalar

        'send auto email
        Dim mailmssg As New MailMessage()
        Dim smtp_client As New SmtpClient

        mailmssg.IsBodyHtml = True
        smtp_client = New SmtpClient
        smtp_client.Host = "ll.smtp.xxxxx.com"
        smtp_client.Port = 25

        mailmssg.From = New MailAddress("zzz@yahoo.com")

        mailmssg.CC.Add("xxxx@yahoo.com")
        mailmssg.Subject = "(Testing)"
        mailmssg.Body = "Testing"

        smtp_client.DeliveryMethod = SmtpDeliveryMethod.Network
        smtp_client.Send(mailmssg)

    End Function
End Class
End Namespace

```