Timeout error using .net DLL

Hi all,

Email PaySlip Generation
We are developing a Payroll software in Navision which has a database in SQL Server.The Scenario which we are trying to implement is that we want to send salary payslip of each employee as HTML file for a particular month to their respective mails configured in outlook Express.

We are taking the salary details of employees for a particular month and year and filling the details in a temporary table using Navision C/AL Code.The temporary table has details of all the employees of that particular Month. W have written a small program in .Net and converted as DLL file. This Dll file will be called in Navision C/AL code. The Dll will perform the data retrieval operation for each employee from the database and incorporate that values in a formatted text string. This string is written into a stream and which is written into a HTML file and send to the respective employee as attachment to his outlook mailbox. Then Next Employee data is retrieved from the database until records of all employees are processed. After all the operations performed by the .NET Dll we will delete the data from the temporary table.

Scenario In Detail:

Step 1:

In Navision C/AL Code.
Filling a Temporary table with salary details of all employees for the selected Month and year.

Step 2:

In .NET Class Library Project (Dll Creation)

We are creating a Project in .NET using Class Library for DLL Creation.

First create a function EmailPaySlip() in a class PaySlip() and in that we will add code to do the following tasks.

Taking Count of Employees in Temporay Table using Connection string and stored Procedure from temporary table of SQL Server Database.
Now Add a Loop so that record for each employee is taken and the following operation is performed in that loop.
Retrieving Data in a Dataset for Each Employee using Connection string and stored Procedure from temporary table of SQL Server Database.
Using String Bulider we are formatting the data in the required output format.
Using StringWriter we are we will write that string data to a stream.
Sending Mail to a employee with the HTML File as attachment.
Next Employee Record is taken until there are no records.

Then After Building that project we get a Dll file. We register that Dll file and export it to assembly cache.

Step 3 :

In Navision C/AL Code.

Then We are Declaring the Respective Dll by creating a variable with datatype as Automation.
We are Calling the Respective Dll in the Navision C/AL code so that data for each employee is retrieved from temporary table and mail be sent to each employee until there are no records left.The process of retrieval of data and mail delivering of each employee is performed for all employees on a single button click.
Deleting the Temporary table after sending mail.

Problem:

This Code is Working Fine in .Net Application before making the .DLL. But After registering the .NET DLL and exporting to Assembly cache successfully and after Calling the respective .NET Dll in Navision C/AL code we are getting an error “The Call to member EmailPaySlip failed. .Net SqlClient Data Provider returned the following message: Timeout expired. The timeout period elapsed prior to completion of the operation or the sever is not responding.” which is attached as screenshot below.

Thanks in Advance

Did you ever get a reply for this question? I’ve just found it in the Tips & Tricks forum, so here nobody really expects to answer it, so I have moved it to the developer forum.