Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Unanswered

Need to extract data in Batches using eConnectOut.

Posted on by 265

Hi,

We are trying to extract data from GreatPlains using eConnect. We are getting the following error when we try to extract large volume of data.

"Failed to allocate a managed memory buffer of 536870912 bytes. The amount of available memory may be low.". So we assume that this issue due to volume of records. So we are trying to implement batching in our extraction. That is getting the  records in batches. It will be helpful if we can get answers for the following.

1) How to resove this "Failed to allocate a managed memory buffer of 536870912 bytes. The amount of available memory may be low." error.

2) How to get the record in batches (100 by 100 or 1000 by 1000).

Any help highly appreciated.

Thanks and Regards

Venkatesan

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Need to extract data in Batches using eConnectOut.

    I have never used eConnect to extract data but my buddy Mariano Gomez has.

    Perhaps this will help.

    community.dynamics.com/.../extracting-data-from-microsoft-dynamics-gp-company-databases-using-sql-server-for-xml-and-xmlnamespaces

  • venkateshmpr Profile Picture
    venkateshmpr 265 on at
    RE: Need to extract data in Batches using eConnectOut.

    Thanks for you replay Richard, Using eConnect we can extract data too. We are trying to extract Sales Transactions. Below is the sample code we used to extract the data.

               eConnectType myEConnectType = new eConnectType();

               RQeConnectOutType myReqType = new RQeConnectOutType();

               eConnectOut myeConnectOut = new eConnectOut();

               myeConnectOut.ACTION = 1;

               myeConnectOut.DOCTYPE = "Sales_Transaction";

               myeConnectOut.OUTPUTTYPE = 2;

               myeConnectOut.FORLIST = 1;

               if (!string.IsNullOrEmpty(filter))

                   myeConnectOut.WhereClause = filter;

               myReqType.eConnectOut = myeConnectOut;

               RQeConnectOutType[] myReqOutType = { myReqType };

               myEConnectType.RQeConnectOutType = myReqOutType;

               MemoryStream myMemStream = new MemoryStream();

               XmlSerializer mySerializer = new XmlSerializer(myEConnectType.GetType());

               mySerializer.Serialize(myMemStream, myEConnectType);

               myMemStream.Position = 0;

               XmlTextReader xmlreader = new XmlTextReader(myMemStream);

               string xmldoc = string.Empty;

               while (xmlreader.Read())

               {

                   xmldoc = xmldoc + xmlreader.ReadOuterXml();

               }

               myMemStream.Close();

               eConnectMethods requester = new eConnectMethods();

               string reqDoc = requester.eConnect_Requester(connString, EnumTypes.ConnectionStringType.SqlClient, xmldoc);

    Thanks and Regards

    Venkatesan

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Need to extract data in Batches using eConnectOut.

    eConnect is used to write data into GP not extract data. Exactly what data are you trying to extract?

  • venkateshmpr Profile Picture
    venkateshmpr 265 on at
    RE: Need to extract data in Batches using eConnectOut.

    Can anyone help here? Need to resolve the issue asap.

    Thanks and Regards

    Venkat

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans