Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with filling drop down list (multi user question) 1

Status
Not open for further replies.

StylizIT

Programmer
Dec 4, 2003
62
NL
can anyone give me some tips on desinging an multiuser asp.NET application with dropdownlists on a form. the ddl's are being filled using a datareader.

I hope my problem sounds familliar.

I'm havin gproblems, when 2 or more users will be logged in. here's the scenario:
==========================================================
user(1) and user(2) are logging in. THe call up the form with de ddl's. THe ddl's are being filled. User(1) selects an item form the list, user 2 selects the same item from the list. user one updates thename attribute in the database, and the ddl is begin refreshed when he presses the update button. The list now has the new name for that item. and the old name is gone.( the old name is gone because I clear the item list and then refill it when the update button is being pressed)

User(2) on the other hand doesn't know that an update took place, but assume he knows, he just selects another item and the list should be updated, but it isn't updated correctly. The new name is being added to the list for user(2) but the old name also exist.
==========================================================

I know why the old name exist, it's because of the function I wrote to fill the dropdownlists. It check's for each value being read form the database if it exists in the item collection, and if not it will add it.

where I need help is the part where usere 2 or 3 or 4 is refreshing the list, how can I make shure they will always get the correct values in the list whenever someone else has updated the name of an item.

thanks in advance




You can better regret that you have done something than regret the fact you done nothing
 
Sty - looks like a good problem - there might be a fairly short eloquent way to do this -- just thought I'd put a thought or two down while I'm here.

You might consider filling up two arrays, to join and compare old and new ID values, having some way of telling the differnce (<>). You might use something like...

Dim arrList As Array
arrList = 'your ID dataset

Dim objItem As Object
For each objItem in arrList()
If arrList(i)...
'do this
Else
'this
End If
i = i + 1
Next

You might have to put the initial array in Session or QueryString.

...anyway, just an idea - to somehow carry out a comparison of the two ID fields, so that you can tell if there is a difference, and then readjust through code...
 
thanks for your reply Isadore, I've been thinking about this solution also, but I didn't know if it would be wise to do so, performance issues etc? Gonna give it a try anyways, thanks.

You can better regret that you have done something than regret the fact you done nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top