in order to correct your varchar vs. int problem.
As for your table locking issue (e.g. your multiple commands issue), it appears as though you will have to split those out (I wish I could point to something in the documentation but I was unable to locate even a part of your error in the docs or the source).