VB.NET app top 1 select statement wont work but does in MSSM
Posted on 2009-05-19
Hi im trying to use this sql select statement in my app but when i call it the app says 'invalid attempt to read when no data is present'.
here is my statement:
myCommand = New SqlCommand("SELECT TOP 1 prospector.ID, prospector.adviserID, prospector.cMonth, prospector.cYear " & _
"FROM prospector ", objConnection)
if i run it without the quotes in MSSM is works perfectly and produces just 1 row. Do i need to change something when i use top 1 in my vb app?