Hi,
I have a program that connectst to a database, ultimately, after a button is pushed it looks for the largest number(in a specific column), increments it and add the row, than returns that number, and a msg box displays the new number.
i have one dll that handles all the connection stuff but, i have two different programs that access this dll, that basically do the same ting (to get the new incremented number)
My problem is, if i push the buttons fast enough on both programs, both message boxes will display the same number, but only one gets added to the database, prob because this column is also the primary key.
My question is, what is the best way of handling this, i am trying to read on transactions or locking the databse some how but im not sure
thanks
I have a program that connectst to a database, ultimately, after a button is pushed it looks for the largest number(in a specific column), increments it and add the row, than returns that number, and a msg box displays the new number.
i have one dll that handles all the connection stuff but, i have two different programs that access this dll, that basically do the same ting (to get the new incremented number)
My problem is, if i push the buttons fast enough on both programs, both message boxes will display the same number, but only one gets added to the database, prob because this column is also the primary key.
My question is, what is the best way of handling this, i am trying to read on transactions or locking the databse some how but im not sure
thanks