cancel
Showing results for 
Search instead for 
Did you mean: 

SAPbobsCOM.Company Error When Reconnecting After Restarting SQL Server

0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

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.

Regards
Edy