SQL 2005 Error Transaction Not initialized message

I have vb.net web application which uses a SQL  database on a SQL 2005 server.
In my development environment. All works fine. When I move it to the web sever I get the
following  SQL error:
ExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized
The code is essentially the following

Private connectStringSQL = "Data Source=tcp:someserver; Initial Catalog=specificDB;User Id=userId;Password=DBPasswd;Connect Timeout=15;"
Private sqlConn 

Public Sub OpenConnection()
   sqlConn = New SqlConnection(connectStringSQL)
End Sub

Sub DoSQLcommand(sqlStatement)
  Trans = sqlConn.BeginTransaction()
  Using AsqlCommand As New SqlCommand(sqlStatement, sqlConn)

        AsqlCommand.Transaction = Trans
     Catch sqex As SqlException
     end Try
   End Using
End Sub
'****at run time *****
'  ****  some things are done 
sqlStatement = ........   'whatever needed

Open in new window

Again this work fine in the development environment but not on the web server.

Any help will be appreciated
Thanks in advance..

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This looks like IIS related issue, an insufficient right to the application pool. Try below:-

Identify the identity of the application pool
Ensure the app pool idenity has a sql user assigned for the organization database
Grant the app pool identity the right db_owner on the organization database
Restart IIS
jimr111998Author Commented:

I am on a shared server and have no control of the IIS,  I have contacted their support with your
response and I'll see what they have to say.  If they provide a solution I give you the points.
jimr111998Author Commented:
Well, it wasn't the server.

the problem was another sql command was being issued but  its
transaction property wasn't set to the current transaction that was started.

the code above was taken out of context and when all the associated code was examined
the offending sql command was detected.

I hope this helps someone.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jimr111998Author Commented:
no other response helped but this is the answer that fixed the problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.