Uploading File Database and Postback Problem

N

needin4mation

Hi, I am uploading a file and changing a record in a database. When
the database is updated, I retrieve the last_insert_id() to get the
latest row key.

I also have a Page_Load event that populates controls on the form.

The Page_Load gets the information from the database, including the
field that has the latest key from my database (say product id).

The problem is that my upload event is slower than the Page_Load event
and the Page_Load even retrieves the old value from the database table
before the database is updated.

I hope this makes sense.

example: I update a product_id in a database table. The page_load
populates a textbox by reading the product_id from the table. The
page_load is reading the old value in the database table before my
update can update it.

I wanted the Update function to fire, then the population of the
controls, but Page_Load beats everything to the punch.

Any help is appreciated.
 
B

Bruce Barker

you need to rebind after an update. move you update code to a common proc.
call it from load, recall it from the update event. or move the bind logic
to the prerender event.

-- bruce (sqlwork.com)
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top