rick Hussain

rick Hussain

  • NA
  • 1
  • 5.9k

Why does it throw a Invalid operation exception?

Oct 5 2010 11:40 PM

hi,
in my method i have the following lines:
 

 try { SqlConnection con = new SqlConnection(@"Data Source=ttt100;Initial Catalog=TEV20;Integrated Security=True"); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; SqlTransaction trn = con.BeginTransaction(); } // there is some code after this...

 
at the linke where i call BeginTransaction() it throws Invalid Operation exception
the following video shows what is excatly happening:  http://www.youtube.com/watch?v=Sc5c40WT89M 
thanks
 
 

Answers (3)