Programming Tools
Problem for Programming Tools
Generic problem for all Programming Tools

Table not gettin updated




By priyanksagi on Dec 07, 2007

" "
hi,
m developing an application using vb 2005 and MS Sql server 2005. At run time the application shows records being added but after closin the application when i view the table no updates have been made...

can u help me out..the same problem occured wid a teachers project i downloaded for reference which comes wid sql server 2005 sample download..the application(both of them) run widout error makin no permanent change in table...
Comments:

Dec 08, 2007

- how to perform commit using vb code for sql server 2005?

Solution #1

posted on Dec 07, 2007
Not Rated)

pasha19

Rank: Guru 
Rating: 86%, 770 votes
Generally database updates either require a commit to have the database perform the appropriate checking and actually flag the rows as part of the database. That Commit can occur in two ways -- some databases can be setup with an auto commit or auto rollback when the database is disconnected. The first means the programmer needs to do nothing. The second means if the programmer does not commit the updates are backed out of the database. To commit is generally considered bad because if there are any data errors partial transactions and logically inconsistent contents can exist in a database. For example entering an order for merchandise requires a single header row to identify the customer and multiple items rows to indicate what was ordered. If the third item record added to an order had an error and the application did not rollback and the database auto committed and incomplete order with only two items would be saved in the database. Traditionally databases with an automatic action at shutdown are set to rollback to assure such partial information is not saved. Even with auto rollback good programs detect errors and rollback themselves and allow users to continue.

The net result of the above is the probability that if the inserts actually occurred as you believe the there was a missing commit to confirm their addition to the database. and an automated rollback kept them from being completely added to the database. Another alternative is that the insert was not error checked in the program code and it failed meaning despite the program counter claiming rows were inserted in fact they were not.

Comments:

Dec 07, 2007

- Sorry error in the above

where it says "to commit is generally considered bad" it should read "to commit automatically is generally considered bad"

Dec 07, 2007

- Programmers generally should include commits and rollbacks as appropriate explicitly in their code.

Dec 08, 2007

- I am not a VB Coder but I can tell you Commit and Rollback are database calls similar to Insert, Update, Delete, Connect and Disconnect.

Microsoft (not exclusively) has several means of addressing database interface including (may be incomplete) ADODB, OLEDB and ODBC among others. A quick web search yielded several possible links however you will need to determine which, if either, is applicable to your environment.

www.vbcode.com/Asp/showsn.asp?theID=12368

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbcode/html/vbtskCodeExampleCreatingTransaction.asp
Was this helpful?
Yes
No

Popular Solutions for Programming Tools


Questions and Unsolved Problems for Programming Tools


Answer
where can I get a customer tool disk for a sharp xa-a41s??

Answer
where can i get the authorization key and serial number for borland turbo c ++

Answer
Using photran 5.0 on eclipse (galileo) 3.5. I am having problems using large integers and reals in... (More)

Answer
How do you get around the problem of large Integers and Reals within photran eclipse? The maximum I... (More)

Answer
Got the Christmas edition r4 upgrade but can't get past the loading screen, not had this problem on... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:







Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Top Programming Tool Experts



Top Computer & Laptop Repairmen

(877) 934-6198
Send your laptop to us and we will diagnose the...
A+ Rated Oceanside Computer Sales & Service, LLC

(952) 890-7770
Zkarlo.com provides discount and used laptop parts...
Zkarlo.com


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select