I'm trying to list the return value from MySQL into excel using vb.net but my problem is only the first row is being inserted in Excel
Here is the return query from MySQL
| Types of Learners | Count |
|---|---|
| Grade 1 | 3 |
| Grade 2 | 4 |
here is my code in VB.NET
Dim Type_of_Learners As String
Dim List_TypesOfLearners_for_Today As String = "SELECT survey_at_what_blh as 'Type of Learners', COUNT(survey_at_what_blh) as COUNT
FROM daily_report
GROUP BY survey_at_what_blh
ORDER BY count DESC"
da = New MySqlDataAdapter(List_TypesOfLearners_for_Today, mycon)
dt = New DataTable()
da.Fill(dt)
Type_of_Learners = dt.Rows(0)("Type of Learners")
xlNewSheet.Cells(66, 8) = Type_of_Learners
Should I use data set?
Type_of_Learners = dt.Rows(0)("Type of Learners")You have to loop with return dataset and fill each row