Как я могу искать и фильтровать данные в datagridview с помощью radiobutton используя VB .NET и мою базу данных mysql
Нет ошибки в моем коде, но нет отображения данных в моем datagridview. Заранее спасибо
Что я уже пробовал:
Private Sub YearlyREp() Dim con As MySqlConnection = New MySqlConnection("server=localhost;user id=root;password=;database=itbcis; Convert Zero DateTime=True") Dim Content As String If (RBproducts.Checked = True) Then Content = "Bondpaper" & "Ballpen" & "Pentelpen" & "Ink" & "Manila Paper" & "Envelop" & "Folder" & "Pencil" RBservices.Checked = False Else : RBservices.Checked = True Content = "Binding" & "Encoding" & "Photocopy" & "Print" & "Scan" RBproducts.Checked = False End If Dim sql As MySqlCommand = New MySqlCommand("Select DATE_FORMAT(Date, '%m/%Y') as Month, ServicesOrProduct, sum(Quantity) as Quantity, sum(Total) as Total from sales where Year(Date) = '" & cbYear.Text & "' and ServicesOrProduct = '" & Content & "' group by ServicesOrProduct, Month(Date) ORDER BY Month(Date)", con) Dim ds As DataSet = New DataSet() Dim da As MySqlDataAdapter = New MySqlDataAdapter() con.Open() da.SelectCommand = sql; da.Fill(ds, "sales") DGVYearly.DataSource = ds DGVYearly.DataMember = "sales" con.Close() End Sub