我在vb.net和mysql中是新的.
当我将Dim SQLConnection定义为MySqlConnection = New MySqlConnection时,我感到困惑.
它说未定义新的“ MySqlConnection”,但我确保已导入所需的名称空间或其他任何名称,但是我仍然有错误,我无法弄清楚问题出在哪里.
这是我的代码:
Imports MySql.Data.MySqlClient
Public Class EditInfo
Dim bednumber As String = ""
Dim patient_name As String = ""
Dim patient_age As String = ""
Dim date_of_confinement As String = ""
Dim type_of_sickness As String = ""
Dim type_of_IV_fluid As String = ""
Dim number_of_bottles As String = ""
Dim drop_rate As String = ""
Dim ServerString As String = "Server=localhost; database=patientinfo;user id=root;password=root" 'connection to phpmyadmin database
Dim SQLConnection As MySqlConnection = New MySqlConnection
Private Sub PatientInfoBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PatientInfoBindingNavigatorSaveItem.Click
Me.Validate()
Me.PatientInfoBindingSource.EndEdit()
Me.PatientInfoTableAdapter.Update(Me.PatientInfoDBDataSet.PatientInfo)
End Sub
任何帮助,将不胜感激.谢谢!我很困惑对不起XD