Click here to Skip to main content
16,022,413 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Hi everybody

I just want to know how to know if the records has been inserted successfully after an sql query in visual basic 2008
Posted

1 solution

Assuming it didn't throw an exception, then it should have worked. But the only way to be sure (if you are feeling seriously paranoid) is to issue a SELECT command and read the record back, then compare it with the data you just inserted.

Shouldn't need it though, and I'm not entirely sure what you will do if you find it isn't right...
 
Share this answer
 
Comments
nourbt 24-Jun-11 5:20am    
Original Griff

My interest in checking that the insert has finished is that I need to close the current form and open another form when the insert has finished
Dave Kreskowiak 24-Jun-11 9:31am    
Unless you're doing the insert operation on a background thread or using Async methods (not common), the call to execute the insert is a blocking call, so the insert is done when your code starts executing the next line of code.
nourbt 24-Jun-11 9:47am    
OK guys i am with you but can anybody help me concerning how to hide the current form and load the other form at the time the query end execution.

I used
Formnew.show()
Me.hide()
but it is not what i need

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900