Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Context Connection "limitation" of one

When you work with a Sql Server 2005 CLR object, you will undoubtably create a connection to the database that you are using.  You will use the "Context Connection=true" setting in your SqlConnection object.  I have inadvertently tried to create two "Context Connection" connection objects at the same time.  You can't do this.  You can only have one "context connection" sqlconnection object open at one time in a CLR Object.

While you can only have one "Context Connection" open at a time within a CLR object, you can have multiple "regular connections" open at the same time within a CLR Object.

Wally

1 Comment

  • It makes sense, I guess. I mean, it'd be like having two "normal" connection objects and trying to get them both to use the same context.



    I assume you can have two objects, though, but only one open at a time - I can definately see the benefit of that.

Comments have been disabled for this content.