尝试
MySqlConn.Open()
Dim Query = "Select * From venuesdb.cost where EventDate >= ('" & DateTimePicker1.Text & "') AND =< ('" & DateTimePicker2.Text & "')"
Command = New MySqlCommand(Query, MySqlConn)
SQLDataAdapter.SelectCommand = Command
SQLDataAdapter.Fill(DatabaseDatSet)
Bindsource.DataSource = DatabaseDatSet
DataGridView1.DataSource = Bindsource
SQLDataAdapter.Update(DatabaseDatSet)
MySqlConn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
MySqlConn.Dispose()
我一直收到错误,说这里有一个SQL错误'&gt; =('“&amp; DateTimePicker2&amp;”')'