tag:blogger.com,1999:blog-11096258.post114363748285173461..comments2024-03-26T09:29:25.252+01:00Comments on InfoWorker Solutions: System.Transactions - Nesting Scopes, Enlist Connection in TransactionKjell-Sverre Jerijærvihttp://www.blogger.com/profile/13654217591841196465noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-11096258.post-87943621048037144152007-10-22T09:25:00.000+02:002007-10-22T09:25:00.000+02:00I don't see how SqlCommand params relates to havin...I don't see how SqlCommand params relates to having a shared, opened SqlConnection used across all the SqlCommand objects. <BR/><BR/>You can use as many different SqlCommand objects as you like, just remember to attach the shared SqlCommand/DbConnectionScope to the commands to stay LTM.Kjell-Sverre Jerijærvihttps://www.blogger.com/profile/13654217591841196465noreply@blogger.comtag:blogger.com,1999:blog-11096258.post-40711624799372679002007-10-22T04:53:00.000+02:002007-10-22T04:53:00.000+02:00That's interesting but seems a bit messy or a lot ...That's interesting but seems a bit messy or a lot just to code this simple code. <BR/><BR/>Yea I know this is like the only work around based on posts I've found but what if you need to add a parameter to your command? <BR/><BR/>You wouldn't want to do this in the InnerMethod as the params are specific to each Query call. <BR/><BR/>If you're calling 2 queries or procs inside a transaction scope, half the time you're gonna need to to add parameters to the command object between these 2 lines in the InnerMethod:<BR/><BR/>SqlCommand cmd = conn.CreateCommand();<BR/>//add parames here but for what query call!! bad<BR/>cmd.ExecuteNonQuery();<BR/> <BR/><BR/>Maybe I'm missing it but you should be able to add these params to your SqlCommand object inside the OuterMethod.Anonymousnoreply@blogger.com