Iskander12345 wrote:but when I use this filter, it often leads to blank chart
That is your specific problem.
Presumably you do not see the MessageBox for the exception ever.
I doubt the suggestion that 'Convert.ToInt32' is relevant. If it was throwing an exception you would see it. It might however return zero which leads to the next problem. It might return zero because that is a valid value though also.
Your code assumes all of the following
- That there are rows of any sort that are returned.
- That the data in those rows is 'valid' (see above.) But also is zero a valid value?
So what happens for the following
1. There are no rows?
2. The data returned is null. Which means id, value1, value2 will be zero?
I am not saying that is what is happening but rather if does that you are not going to get anything. So you need to check for that.
Perhaps as a minimum you should check the following
1. If there are no rows returned post (new MessageBox) and error about that. You should probably also post 'RawDataOrder'
2. Check that at least one (maybe two) rows exist and that both have non-zero data. If not post a different MessageBox error.