Skip to Content

SAPbobsCOM.Company Error When Reconnecting After Restarting SQL Server

I have a windows service (C#) that integrates with SAP B1. When SQL Server is restarted during the execution of the service the Company object loses the reference giving several errors and does not reconnect, being necessary to restart the service manually.
I'm trying to reconnect to the database while running but need to reload the Company object, but I'm not getting it.

Any tips on how to discard the old Company and redo a new one?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 10, 2018 at 01:00 AM

    Hi Rodrigo,

    The old company object will be useless. You may need to create a new company object
    Problem is the old company object will not release its memory usage.
    Another solution: make your service as just a controller to another application that contains the company object.
    When company object cannot be restarted, your service should stop the application and restart it.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.