Solved

Closed dataset error

Posted on 2006-07-19
4
897 Views
Last Modified: 2012-06-21
Everytime I use the SalesLogix client to connect to the database I get a "Cannot perform this operation on a closed dataset"

Any ideas on how to get the client to connect to the database.

We are using Windows 2000 server and SQL 2000

0
Comment
Question by:pbraden
  • 2
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 17139019
Hi pbraden,

This is probably the Set NOCOUNT OFF issue. If you have a complex stored procedure which performs more than a single select, you may get more than one dataset result returned. These results contain the messages that you would normally see in query analyzer and not the data you expect to see (well one of the datasets returned does, just not necessarily the first).

There are basically two ways to resolve the issue, either from your client you need to use .NextRecordset or .NextResult or whatever equivalent method is available in your client. Or you change the stored procedure that you are calling and add "SET NOCOUNT OFF" before the code that is executed in the SP. This latter option suppresses these messages and allows the data to be returned in the first resultset.

Tim Cottee
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17140372
Tim,

>>Or you change the stored procedure that you are calling and add "SET NOCOUNT OFF" <<
I think you mean SET NOCOUNT ON.  Otherwise we have the default and messages will be displayed.  It is after all a double-negative :)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 17142250
acperkins, it was hot and minutes before I was leaving work. That's my excuse anyway, the thought was there.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17143352
>>That's my excuse anyway, the thought was there.<<
Most definitely, did not mean to steal your thunder, I just wish Microsoft had called it SET COUNT OFF :)

Anthony
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question