There is no one article that will do what you want. Your requirements are a combination of a bunch of smaller techniques that need to be put together correctly. What's with the "random" order number? I've never seen a requirement where the order number must be random. I've only seen "serial number" type order numbers. How I've seen it done in the past, and I've done this myself, is to have a seperate table in the database that holds your databases status and statistics, such as the last used order number. Your code would call a stored procedure in the database that retrieves the last used order number, increments it, stores it back in the table and creates a blank order record in the "orders" table, using the newly created order number. Then this record is sent back to your program as a dataset (SELECT statement). Your app then fills in the details of the order and writes back the order record, without having to worry about the order number at all. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome