And what record does it return? Does it return any data at all?
There are a few issues with your code that make it hard to track this down, especially for me. Try fixing that before you move on:
1. Strongly type your method parameters. What is txtName? Is it a string? Then make it explicit:
Sub getInfo(ByVal txtName As String)
That way, you can be sure you're not passing an entire TextBox which, using ToString, results in the literal TextBox instead of the actual value.
2. Don't use Exec.
AFAIK, you don't need it.
3. What is i? Does it have the correct value?
Once you fix these issues, try turning on the SQL Profiler and see what gets sent to the database. Alternatively, select the input parameter:
SELECT @txtName FROM SomeTable
so you can what you're passing to it.
Debug the code and see what is being passed and what is being returned.
Also, this may help:
http://msdn.microsoft.com/en-us/libr...y8(VS.71).aspx
And stored procedures have implicit return values if you don't specify them.
Cheers,
Imar