No Row at Position 1 Error

B

Brett

First some up front notes.

This routine (see below) works fine in my localhost, but crashes in on my
test server and in production with “No row at position 1â€. ALL are hitting
the SAME database, so the data is there.

Basically, I am creating dataviews on the fly to feed child grids (again,
see the code below). If I comment out, the filtering command, the test
system doesn’t crash anymore and I get child grids. Wrong data of course,
but I grids. I’ve seen a couple of posts that hint at a threading issue, but
nothing specific to my problem.

Here's the code:
--------------------------------
Protected Function GetVenuesInAreaOfPlay(ByVal iAreaOfPlayID As Integer) As
DataView

dvVenuesInAreaOfPlay.RowFilter = "AreaOfPlayID = " + iAreaOfPlayID.ToString
Return dvVenuesInAreaOfPlay

End Function
 
S

Stan

First some up front notes.

This routine (see below) works fine in my localhost, but crashes in on my
test server and in production with "No row at position 1". ALL are hitting
the SAME database, so the data is there.

Basically, I am creating dataviews on the fly to feed child grids (again,
see the code below). If I comment out, the filtering command, the test
system doesn't crash anymore and I get child grids. Wrong data of course,
but I grids. I've seen a couple of posts that hint at a threading issue, but
nothing specific to my problem.

Here's the code:
--------------------------------
Protected Function GetVenuesInAreaOfPlay(ByVal iAreaOfPlayID As Integer) As
DataView

dvVenuesInAreaOfPlay.RowFilter = "AreaOfPlayID = " + iAreaOfPlayID.ToString
Return dvVenuesInAreaOfPlay

End Function

Hi

There is no obvious reason why the function should raise an exception.

However your coding is slightly odd. It sets the RowFilter property of
what appears to be a DataView object that is global in scope (i.e.
declared elsewhere) and then returns a superflous reference to it.

It would be more appropriate as a procedure or subroutine thus:

Protected Sub GetVenuesInAreaOfPlay(ByVal iAreaOfPlayID As Integer)

dvVenuesInAreaOfPlay.RowFilter = "AreaOfPlayID = " +
iAreaOfPlayID.ToString

End Sub

Try ammending it and then review the rest of your code so that any
calls to the function are ammended accordingly, i.e. as an execution
statement not an assignment statement (or as part of an expression).

It's just possible that oddity was causing the problem.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top