Given the path you chose, writing $i=0$ was right as there's no current inside that loop, but writing $B2\pi a$ wasn't. The integral form for the Ampere law is
$B$ and your chosen path $dl$ are perpendicular, therefore the dot product results null. Then, this path doesn't allow you to calculate $B$ as your equation is zero from both sides. There's the difficulty of this kind of problems: choosing the correct path that gives information.
Try to select another path where $dl$ and $B$ are parallel, and where the current gives you information.