MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Recordset exception. What am I doing wrong?

This is a discussion on Recordset exception. What am I doing wrong? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Here is some test code in my program that I used to hunt down an exception. MapPoint.DataSet assignedMembers = oMap.DataSets.AddPushpinSet( ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-24-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Recordset exception. What am I doing wrong?

Here is some test code in my program that I used to hunt down an exception.

MapPoint.DataSet assignedMembers = oMap.DataSets.AddPushpinSet(
"Membership2" );
// Add 0 or more pushpins to the dataset
MapPoint.Recordset rs;
for ( int i = 0; i < 500 ; i++)
{
rs = assignedMembers.QueryAllRecords();
}

Regardless of how many pushpins are added to the dataset, there will always
be an unknown COM exception thrown when i = 201.

Is there something that needs to be done to dispose, reset, delete, release,
or reset the Recordset?

Help me Obe Wan Kenobe. You are my last hope.

--
Regards.
Mark K Vallevand
mark.vallevand@unisys.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-25-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Someone made this suggestion:

I think you either need to call ReleaseDispatch() between invocations of
QueryAllRecords() or create a "new" Recordset each time and delete when you're done.

I don't grok this. ReleaseDispatch() is on what object? I don't see it anywhere.

What do you mean by "new" and "delete" Recordset? QueryAllRecords() returns a Recordset. I assume that C# manages this object like others. I don't need to explicitly delete it.

I'm missing something obvious or fundamental.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-25-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
OK. This guy was talking C++. This is C#.

Has anyone ever called any of the query methods and gotten more than 200 recordsets?

I think there is a bug here.

Regards.
Mark K Vallevand
mark.vallevand@unisys.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-25-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
OK. I found it. If you force garbage collection, the recordset objects get released and the COM interface is happy.

Added this code:
System.GC.Collect();

System.GC.WaitForPendingFinalizers();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
exception, recordset, wrong


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
OutOfMemory Exception Gianmaria MapPoint 2006/2009 Discussion 1 01-24-2006 12:26 PM
Regarding COM exception at the end of execution... Anonymous MP2K Magazine Articles 0 05-12-2005 12:23 PM
Unknown Host Exception amitsh MapPoint 2006/2009 Discussion 2 11-03-2004 11:18 PM
What am i doing wrong??? alt-088 MapPoint 2006/2009 Discussion 2 09-16-2004 03:37 PM
Deriving a recordset from a mappoint recordset RichardHayes MapPoint 2006/2009 Discussion 0 09-06-2002 02:44 AM


All times are GMT -5. The time now is 09:37 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Cheap Skiing
When it comes to cheap skiing, Holiday Hypermarket will speed you on your way. Searching the leading travel brands, Holiday Hypermarket offers you great value skiing.

Travel Agent UK
Travel Counsellors was named UK's Best Travel Agent at the Guardian Unlimited travel awards. Whatever your travel needs we can help.

Holidays Cuba
When you book holidays in Cuba you will find a fascinating country with a heady combination of Spanish, African and Caribbean influences. Check our great deals.

Holidays to Cuba
For the best offers on holidays to Cuba, visit The Holiday Place today. Find a deal to suit you and your budget online!

Cheap Canaries Holidays
Are you hunting down cheap Canaries holidays? Well check out ulookubook.com to bag a great value holiday. There are numerous festivals taking place all year round. Why not book your holiday around one?

Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk

Cheap Holidays to Lanzarote
Visit the Canary Islands, even if you're cash strapped! View cheap holidays to Lanzarote at On The Beach!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52