Blog

View Blog

Oct 31

Written by: Rainer Stropek
10/31/2005

Multiple Active Result Sets (MARS)

I created some sample applications to demonstrate MARS (MultipleActiveResultSets), a new feature of SQL 2005 and .NET 2. For this I used the various CTPs that Microsoft delivered. Since friday the RTM versions of SQL 2005 and Visual Studio 2005 have been available. Of course I could not wait to get my hands on it. Therefore I reinstalled my laptop and installed the new RTM bits.

Interestingly my MARS-samples do not execute anymore. I get the following exception:

The connection does not support MultipleActiveResultSets.

It seams that Microsoft changed the behavior of MARS from CTP to RTM. Now you have to specify an additional keyword within the connection string to explicitly enable MARS:

server=localhost;uid=demo;pwd=demo;database=AdventureWorks;async=true;MultipleActiveResultSets=true

With this change my MARS samples work fine. Heureka!

SQLDependency

Hey, what happened to SQLDependency? My application worked fine with VS2005 RC, it does not when I execute it with the RTM version. The following exception appears:

When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.

This exception is quite simple to correct. As the error message says there is a new function SqlDependency.Start that has to be executed in order to start the listener for receiving dependency change notifications from an instance of SQL2005:

SqlDependency.Start(connectionString.ConnectionString);

create endpoint

In previous releases of SQL2005 (e. g. June CTP) create endpoint did not care about whether IIS was listening on the same port that you specified. The RTM version of SQL2005 will not let you create an HTTP endpoint if IIS uses the same port (I tested with WindowsXP and developer edition of SQL2005):

An error occurred while attempting to register the endpoint '[...]'. One or more of the ports specified in the CREATE ENDPOINT statement may be bound to another process. Attempt the statement again with a different port or use netstat to find the application currently using the port and resolve the conflict.

You can resolve this issue by specifiying an alternate port that SQL2005 should use:

create endpoint [...]
as http ( path = '[...]', AUTHENTICATION = (INTEGRATED), PORTS = ( CLEAR ), CLEAR_PORT = 8080 ) for soap ( [...] )

UNSAFE assemblies

If you want to create an assembly with UNSAFE permission set the database has to have its trustworthy property set to on:

alter database AdventureWorks set trustworthy on

Tags:

6 comments so far...

Re: Changed behavior between VS2005/SQL2005 release candidate and RTM

SqlDependency.Start(connectionString.ConnectionString)
Good this saved my life for the INETA Launch, I was having that error on the Query Notifications demo.

Lizet

By Anonymous on   3/7/2008

Re: Changed behavior between VS2005/SQL2005 release candidate and RTM

SqlDependency.Start(connectionString.ConnectionString)
Good this saved my life for the INETA Launch, I was having that error on the Query Notifications demo.

Lizet

By Anonymous on   3/7/2008

Re: Changed behavior between VS2005/SQL2005 release candidate and RTM

this Exception of not letting me to create endpoints was bugging me late,this posting was lifesaving

By Anonymous on   3/7/2008

Re: Changed behavior between VS2005/SQL2005 release candidate and RTM

the HTTP endpoint exception has disappeared thanx to, but the problem is that when i try to browse the WSDL XML documnet for the HTTP endpoint by typing "http://localhost or (what ever the machine is) /?WSDL" i get nothing: "The Page can not be found", although i checked the SQL Server 2005 through the Surface Area Configration,and it says the HTTP endpoint exists and is started,so whats up?

By Anonymous on   3/7/2008

This does not work at all.

Where did you get this?
SqlDependency.Start(connectionString.ConnectionString);
It doesn't work at all.

By Anonymous on   3/7/2008

Re: Changed behavior between VS2005/SQL2005 release candidate and RTM

Now you can start microsoft exam 70-536 to draw the form. The easiest way to begin is to drag the fields from the data source pane onto the form. This is even possible for repeating groups (e. g. Items); in such cases oca exam InfoPath will create repeating groups. By right-clicking on fields you can change the field type. With this you can make a field read-only or convert it into a combobox. Comboboxes can be bound to the result of oracle 10g dba a data source:

By mainmarry on   2/4/2010

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment    Cancel  

Newsletter

Sie möchten im Newsletter über aktuelle technische Entwicklungen und Neuigkeiten rund um cubido informiert werden?

Newsletter abonnieren ...

Blog