473,413 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Uploading File Database and Postback Problem

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.

Nov 19 '05 #1
1 1237
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)

<ne***********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
0
by: Dom | last post by:
Hi I want to allow users upload a variable number of files from a single page. User nominates the number of files and then is presented with a corresponding number of input boxes. I create...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Lou | last post by:
I have a web application using vb.net and sql server 2000 in which I generate templates for documents by using the database to fill certain fields with an XSLT file to generate RTF for display on...
4
by: Himanshu | last post by:
hi, Can anybody tell me that thru asp.net using c#, how can we upload and download physical files in any table of SQL Server Database. the uploading part is running successfully but the...
6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.