Hi all,
I have a method which calls a process sometimes longer than usual.
Here code:
Development side works fast and the problem is not there. On the production side, being the largest db, it takes a few more seconds and an error comes out.
The method times out and I find null. DB is SQL SERVER in LAN.
How can I do?
Thanks
A.
I have a method which calls a process sometimes longer than usual.
Here code:
C#:
private async void LoadAll()
{
try
{
await Task.Run(() =>
{
details = new Docs().LoadProduct();
// process very slow, about 25/30 seconds
});
foreach (var d in details)
{
// at this point, details is null
}
}
catch (Exception ex)
{
// Error shows timeout error
MessageBox.Show("ERROR: " + ex.Message);
}
}
Development side works fast and the problem is not there. On the production side, being the largest db, it takes a few more seconds and an error comes out.
The method times out and I find null. DB is SQL SERVER in LAN.
How can I do?
Thanks
A.