none
Sql Server connection

    Question

  • I am using WCF with Sql Server.  i wrote a TSQL to create a CURSOR, populated with a SELECT.  this is executed from the client, leaving the connection open.  The client then executes a FETCH to retrieve records, but the connection is closed.  Any ideas how to keep the connection open would be apprecaited.

    Monday, March 09, 2009 7:04 PM

Answers

All replies

  • First off, you really, really, really don't want to do this. Leaving a connection open from the client will end up causing you to run out of connections since there are a limited number.

    Second off, this is the wrong forum for this type of question. This forum is for questions about javascript with Silverlight. I'd try the WCF forums.

    Monday, March 09, 2009 8:04 PM
  • so in your opinion, i should not create a cursor, but execute a new query for each page down and page up?  when one searches say google, does it not keep a server cursor to page through the results?

    Monday, March 09, 2009 8:10 PM
  • No, they do not keep any cursors open at Google (they probably don't use cursors actually).

    Take a look at this paging article here, probably a step in the right direction.

    Monday, March 09, 2009 8:20 PM
  • yeah, had considered that architecture.  there are a couple of problems there.  first, it creates a new query with each server hit.  second, if data changes inbetween queries, the results change.  a cursor would be perfect, this is exactly what it is for.  if somehow the connection could be maintained on the server, and the client reconnect to it, or something.

    the problem with the WCF forum is many features available in other platforms are not available in SIlverlight, so for Silverlight applications I prefer to stay here.  but i do appreciate the suggestions.

    Monday, March 09, 2009 11:16 PM