Showing posts with label namespace. Show all posts
Showing posts with label namespace. Show all posts

Friday, March 9, 2012

Missing SqlContext.GetCommand() in new namespace

I'm just starting with using the SQLCLR features in SSX, and I'm following the most recent Beta 2 MSDN docs. I created an SQL Server project and made a simple stored procedure method, and the problem now is the docs refer to SqlContext.GetCommand( ) inside the stored procedure method to return an SqlCommand object, but this method does not exist.
I did some searches and noticed that the MSDN docs still refer to the old System.Data.SqlServer namespace where it has been replaced by Microsoft.SqlServer.Server in Beta 2.In the latest CTP (April), the server side provider has been merged with the client side, so you no longer reference sqlaccess.dll.
In addition you no longer do SqlContext.Connection/Command etc., but you get your connection through:
SqlConnection conn = new SqlConnection("Context Connection=true");
subsequently you get create your command as you'd have done in a client app:
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
or:
SqlCommand cmd = conn.CreateCommand():
You use the SqlContext to get your Pipe object and for the TransactionContext etc.
Hope this helps!!
Niels|||Thanks. I've been looking for that. Is there a page/blog where I can see all those updates to the API?|||Pablo Castro (PM at MS) wrote a MSDN article about it here.
A couple of blogs that cover this stuff is mine and Bob Beauchemins. Pablo and his team at MS also has a blog which is worth following.

Saturday, February 25, 2012

Missing namespace ReportingService

The type or namespace name 'ReportingService' could not be found (are you missing a using directive or an assembly reference?)

What is missing ?

Do I need to install something because in the I do get it in intelliscence

i am using this code

ReportingService.ReportingService rs =new ReportingService.ReportingService();

Thanks


Make sure that you have added that as a reference in your reference section in the project.

|||

how do I add a reference to my project|||

Goto Solutions Explorer. This can be found in the View menu (Ctrl + W + S) in visual studio 2005

under the project, you should see a link called Reference

right click the reference and select add reference.

you will see list of component name. Select the neccessary component / assembly and click OK

|||

there are so many which one should I select for ReportingService

Thanks

|||

Microsoft.ReportingServices