if i declare con and rs outside the function vb gives me error like

"declaration is not allowed here"......

and if i declare them (function or variable) public then also an error message occurs
what should i do?