vb.net MYSQL Pie Chart (newbie)
vb.net MYSQL Pie Chart (newbie)
image1this is my code from pie chart but it is not showing help plz :(. the database is scholar1. and datascholar is the student who is registered from the table.every student has there own year level so i create a pie chart .who has many registered student in the pie chart. 1st year to 5th year.
Private Sub chartbtn_Click(ByVal sender As Object, e As EventArgs) Handles chartbtn.Click
TabControl1.SelectTab(2)
Label4.Text = "PGO - SCHOLAR : CHART"
Dim connection As New MySqlConnection
connection.ConnectionString = "server=localhost;userid=root;password=;database=scholar1;SslMode=none"
Dim READER As MySqlDataReader
Dim query As String
Try
connection.Open()
query = "SELECT * FROM datascholar"
Dim command As New MySqlCommand(query, connection)
READER = command.ExecuteReader
While READER.Read
Chart1.Series("Year_Level").Points.AddXY(READER.GetString("year"), READER.GetString("year"))
End While
connection.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
connection.Dispose()
End Try
End Sub
datascholar
READER.GetString("year")
i just want to show who is the most registered in the program. 1st year to 5th year.
– Jan Kenzi Masangkay
Jul 2 at 1:16
And we don't know what data in
datascholar is useful for showing the chart of who is most registered in the program. You need to update your question and show the column names of datascholar table and the sample data of it. And also tell us which columns of the table you want to show on the chart.– Chetan Ranpariya
Jul 2 at 1:33
datascholar
who is most registered in the program
datascholar
i already updated my question thank you
– Jan Kenzi Masangkay
Jul 2 at 1:48
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Nothing clear from your code. On what data of
datascholaryou want to show the chart? You are havingREADER.GetString("year")as both X and Y, why?– Chetan Ranpariya
Jul 2 at 1:12