Context Connection connection strings

Connects to

SQL Server 2012

  • Context Connection

    Connecting to "self" from within your CLR stored prodedure/function. The context connection lets you execute Transact-SQL statements in the same context (connection) that your code was invoked in the first place.

    C#
     using(SqlConnection connection = new SqlConnection("context connection=true"))
     {
         connection.Open();
         // Use the connection
     }

    VB.Net
     Using connection as new SqlConnection("context connection=true")
         connection.Open()
         ' Use the connection
     End Using
Problems connecting?
Get answer in the SQL Server 2012 Q & A forum

SQL Server 2008

  • Context Connection

    Connecting to "self" from within your CLR stored prodedure/function. The context connection lets you execute Transact-SQL statements in the same context (connection) that your code was invoked in the first place.

    C#
     using(SqlConnection connection = new SqlConnection("context connection=true"))
     {
         connection.Open();
         // Use the connection
     }

    VB.Net
     Using connection as new SqlConnection("context connection=true")
         connection.Open()
         ' Use the connection
     End Using

SQL Server 2005

  • Context Connection

    Connecting to "self" from within your CLR stored prodedure/function. The context connection lets you execute Transact-SQL statements in the same context (connection) that your code was invoked in the first place.

    C#
     using(SqlConnection connection = new SqlConnection("context connection=true"))
     {
         connection.Open();
         // Use the connection
     }

    VB.Net
     Using connection as new SqlConnection("context connection=true")
         connection.Open()
         ' Use the connection
     End Using
.NET Framework Class LibraryInfo and class library downloads

Providers

Connect

Articlesread all »

Didn't find your connection string?

Start over from the connection string reference index - or try a search!

In the Q&A forums you can ask your own question and let somebody help you.

The knowledge articles contains solutions and guides.