Hi, I have been experimenting with graphs in a windows form using VB.NET
I have had some success as I can now extract data in to my graph.
I created a windows form and dragged a chart on to it using Visual studio 2019. I then placed a button on the form. Inside the button click I have this code.
In my database table I have a column called company and a column called id, the code below successfully extracts the data. But I have now placed a label on my form that labels text shows a specific company name i.e. 'roman.plc'
How can I get my chart to only show data that matches the company name in the label. Because at the moment it shows all company names in the table.
Try Using con As New MySqlConnection("server=Server ip; userid=User; password=MyPassword; database=DatabaseName") cmd.Connection = con cmd.CommandText = ("select * FROM Registrations ") con.Open() Dim reader = cmd.ExecuteReader() While reader.Read() Chart1.Series("COMPANY_V_ID").Points.AddXY(reader.GetString("Company"), reader.GetInt32("id")) End While con.Close() End Using Catch ex As Exception MessageBox.Show(ex.Message) End Try