0
當然,我相信這很容易,但我堅持出於某種原因。 我有以下選擇數據庫中的名稱,如果他們開始變量s。 但我沒有得到結果。vbnet執行像查詢變量
Public Sub load_oraria_EPAFES_FORM2(ByVal DATAGRID As DataGridView, ByVal LETTER As Button)
Dim sda As New MySqlDataAdapter
Dim dbdataset As New DataTable
Dim bsource As New BindingSource
conn()
Try
MessageBox.Show(LETTER.Text)
mysqlconn.Open()
dbdataset.Clear()
Dim query As String
query = "select * from db.epafes WHERE (SURNAME LIKE '%" & LETTER.Text & "% ') "
command = New MySqlCommand(query, mysqlconn)
sda.SelectCommand = command
sda.Fill(dbdataset)
bsource.DataSource = dbdataset
DATAGRID.DataSource = bsource
sda.Update(dbdataset)
mysqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mysqlconn.Dispose()
End Try
End Sub