For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > January 2005 > Empty dataset with multiple requests









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Empty dataset with multiple requests
ghause

2005-01-31, 4:00 pm

When I have two users click a button with 1 sec of each other, one of the
users is returned an empty dataset, resulting in a 'no row at position 0
error'.

Here is an obfuscated snippet:

Dim objCustomerFacade As New CustomerFacade()
Dim Customer As New TypedDataset
Customer = objCustomerFacade.Login(Username, Password)
With Customer
Me.AccountId = CType(.CUSTOMER_TABLE(0).ACCOUNT_ID, Integer)
End With

Me.AccountId is a public property defined in my custom page base class,
which inherits from System.Web.UI.Page. CustomerFacade is a class between the
UI and the data layer.

I am using the 1.0 framework. Any thoughts are appreciated. I've been
leaning toward a threading problem, but datasets are thread safe aren't they?
Cowboy (Gregory A. Beamer) - MVP

2005-01-31, 4:00 pm

Based on what little you have given me, I would look and see if you are
running exclusive locks on the database that populates your "facade" object.
Very common if you are using Access, but possible with other databases.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"ghause" wrote:

> When I have two users click a button with 1 sec of each other, one of the
> users is returned an empty dataset, resulting in a 'no row at position 0
> error'.
>
> Here is an obfuscated snippet:
>
> Dim objCustomerFacade As New CustomerFacade()
> Dim Customer As New TypedDataset
> Customer = objCustomerFacade.Login(Username, Password)
> With Customer
> Me.AccountId = CType(.CUSTOMER_TABLE(0).ACCOUNT_ID, Integer)
> End With
>
> Me.AccountId is a public property defined in my custom page base class,
> which inherits from System.Web.UI.Page. CustomerFacade is a class between the
> UI and the data layer.
>
> I am using the 1.0 framework. Any thoughts are appreciated. I've been
> leaning toward a threading problem, but datasets are thread safe aren't they?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com