Whenever I have
Dim catID as integer
And I use this in a query like this:
cmd.CommandText = \"select * from categories where p
Just remove single quotes:
cmd.CommandText = "select * from categories where parentid=" + catID.ToString()