mysql connectionstrings_未定义类型’MySqlConnection’

在app_code中创建函数调用类时,我在以下代码上遇到错误.

我的错误正在显示-> BC30002:类型’MySqlConnection’未定义.请帮忙.谢谢!

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

  • 0
    点赞
  • 0
    收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:数字20 设计师:CSDN官方博客 返回首页
评论

打赏作者

欧义

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值