I had the same problem. I solved this by doing this in my code:
If MySQLReader.Read Then
Chart1.DataSource = MySQLReader
Chart1.Series("Series1").XValueMember = "XValue"
Chart1.Series("Series1").YValueMembers = "YValue"
Chart1.Height = 500
Chart1.Width = 750
Chart1.DataBind()
LBLError.Text = ""
Else
Chart1.Visible = False
LBLError.Text = "Your search did not match any records in the database"
MySQLReader.Close()
MyConn.Close()
End If
Hope this helps.
James source
share