469,889 Members | 1,164 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,889 developers. It's quick & easy.

Transaction error

Hello,
i have a windows form application and i want to use an insert command within a transaction so i satrt the transaction : ( Conn is my connection object )

System.Data.OleDb.OleDbTransaction Trans;
Trans = Conn.BeginTransaction();
Trans.Begin();

then i use this transaction in another function that uses the insert command:
"the transaction assigned to this command must be the most nested pending local transaction "

i dont understand this error
so can anyone help me?
thanks
func( ref Trans );

private void Func ( ref System.Data.OleDb.OleDbTransaction Trans )
{
System.Data.OleDb.OleDbCommand InsCom;

InsCom = new System.Data.OleDb.OleDbCommand(InsStr,Conn);
InsCom.Transaction = Trans;
InsCom.ExecuteNonQuery() ;
}

and i get the following error:

Nov 16 '05 #1
0 1985

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sam | last post: by
10 posts views Thread by TZoner | last post: by
2 posts views Thread by Dano | last post: by
1 post views Thread by Matik | last post: by
1 post views Thread by cricketweb | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.