How are you declaring the "ids" variable? Is it being declared in a "Using" statement?
Using ids as Int
You'll have to pardon my lack of knowledge about VB syntax, as I'm more familiar with C#.
The "Using" statement allows you to declare a variable that will be disposed at the end of that code block, which works nice for database connections. The variable you declare in the "Using" statement must implement the System.IDisposable interface. Integer variables do not implement this interface, therefore you cannot declare a new integer variable in the "Using" statement.
Using [B]ids as Int[/B]
Using conn as new SqlConnection(...)
[B]ids as Int[/B]
You can declare a new integer variable inside the code block for the "Using" statement.
Though it is difficult to know what the problem is because I don't see the line of code declaring the "ids" variable.