Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > No Row at Position 1 Error

Reply
Thread Tools

No Row at Position 1 Error

 
 
Brett
Guest
Posts: n/a
 
      03-19-2008
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
--------------------------------

Thanks for any help you can provide.


 
Reply With Quote
 
 
 
 
Stan
Guest
Posts: n/a
 
      03-21-2008
On 19 Mar, 19:59, Brett <Br...@discussions.microsoft.com> wrote:
> 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
> --------------------------------
>
> Thanks for any help you can provide.


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is Form Relative Position and Absolute Position in VS.Net 2005 ? Luqman ASP .Net 1 02-07-2006 10:27 AM
position image based on document position edouard.lauer@pt.lu Javascript 3 01-14-2006 06:04 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
How to set position of a web control depending on other control's position at run-time? James Wong ASP .Net Web Controls 4 07-14-2004 10:24 AM
Runtime error "no row at position 0" when trying to access WebMethod arguments Ana Lindt ASP .Net Web Services 1 05-31-2004 06:17 PM



Advertisments