Click here to Skip to main content
14,983,551 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

In my application i am printing a text file data to a printer.
and after that i am sending the transaction id's of the printed lines back to the server to update them as printed.

Please tell me how to rollback the transactions of the printing didn't happens.
e.g. sometime it happens like the paper will go inside but it comes back without printing anything and it use to update the database also.

Please help me how to do this.
DamithSL 2-Nov-14 23:16pm
are you using transactions? can you update the question with your code?

1 solution


The status of printers and print jobs are updated by the Win32 Spooler during the despool of a print job. At all other times, when that printer is not despooling and reports no state information, the printer is considered to be ready and idle.

You get the status of the printer and on the basis of which you can rollback your transaction else, you can commit your transaction.

See these links:[^][^]

For a more detailed version, check this out :
Monitoring a Printer Queue from VB.NET[^]

Hope this helps !! :) :)

BillWoodruff 3-Nov-14 1:40am
+5 Excellent answer.
[no name] 3-Nov-14 1:48am
Thanks Bill :)
Black_Rose 3-Nov-14 2:05am

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