CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Framework Design, Agile Coach, President Oklahoma City Developers Group, Microsoft MVP C#, TDD, Continuous Integration, Patterns and Practices, Domain Driven Design, Speaker, VB.Net, C# and Sql Server

A few changes from Beta 1 to Beta 2 when writing code for SQLCLR

First of all, if you only downloaded the standard Visual Studio 2005 Beta 2, you will have have available the “New Sql Project”.  You must download the VSTS in order to get the professional version where you will find sql projects in visual studio.

So I took some of my SQL Server projects from Beta 1 and moved them to Beta 2.  A few things you’ll want to be aware of, and looking in the April CTP of MSDN will not provide you the answers. 

The old System.Data.SqlServer namespace has been replaced by Microsoft.SqlServer.Server in Beta 2.  The server side provider has been merged with the client side, so you no longer reference sqlaccess.dll.

SqlContext.GetPipe has changed to just SqlContext.Pipe.  That one was easy enough to find.

This was a bit harder, as I kept looking and looking for it.  You can no longer do SqlContext.Connection/Command etc.  If you done some of this in Beta 1 you’ll remember using SqlContext.GetCommand which returned a command object within the current context.  That has alltogether been removed.  Now you obtain a connection by using SqlConnection conn = new SqlConnection("Context Connection=true"); or Dim conn As SqlConnection = New SqlConnection(“Context Connection=true”) in VB.  By including the parameter Context Connection, this provides the same functionallity as SqlContext.GetCommand was providing.

Pablo Castro over at Microsoft wrote an article up on MSDN here for more information.



About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!