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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undo sql database changes

Status
Not open for further replies.

SeaweedOPM

Technical User
Nov 19, 2004
53
US
I'm using web matrix for this one. The easiest way to explay is that i have three tables in a database being used. If i had the ability to have a multi column list box then i could do everything i want. Basically any additions to the database (for the current session) i want added into the listbox, grid or whatever. If there was an error i want them to be able to select it, press a button and i'll send a delete command to the apropriate record. What do I do?
 
at the beginning make two datasets, use one to make the changes and one with the original data. If there si an error then you still have the unchanged dataset to set it all back the way it was.

BTW webmatrix is very bugy.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Couldn't you also do DataSet.RejectChanges to get the data back to it's original form?
 
The solution that I ended up with was to take the id of the newly made row with:
scopeid = dbcommand.ExecuteScalar

then I added an item to a listbox containing

add(scopeid & ": " & text & " - " & text)

Then to delete the record i made a delete command with the id as parameter and got the id by:

Dim pos As integer, id As integer

pos = instr(lbxRecent.SelectedItem.Text, ":")
id = left(lbxRecent.SelectedItem.Text, pos - 1)
lbxRecent.Items.Remove(lbxRecent.SelectedItem)
DelRecent(id) 'Deleteds the record with the "id"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top