What is the 'c' variable? Do you mean 'counter'? IE, your code is not functional. Also, if you mean 'counter' instead of 'c', then you are setting a[*counter] to 0, so the value scanned would be set to 0, before being set to what was found int the stdin stream...
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...