tags:

views:

238

answers:

1

I'm running this query in LINQ:

var unalloc = db.slot_sp_getUnallocatedJobs("Repair", 
                  RadComboBox1.SelectedValue, 20);

It runs when I first open the page, but when I go back to it and try to run the same query with a different value, "Con", being passed through, the linq to sql designer.cs tells me that I've got a timeout error.

Any ideas?

Edit: This is what's in the designer:

[Function(Name="dbo.slot_sp_getUnallocatedJobs")]
Public ISingleResult<slot_sp_getUnallocatedJobsResult> slot_sp_getUnallocatedJobs([Parameter(Name="JobType", DbType="VarChar(20)")] string jobType, [Parameter(Name="Contract", DbType="VarChar(10)")] string contract, [Parameter(Name="Num", DbType="Int")] System.Nullable<int> num)
     {
      IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), jobType, contract, num);
      return ((ISingleResult<slot_sp_getUnallocatedJobsResult>)(result.ReturnValue));
     }
    }

This is the error:

SQLException was unhandled by user code
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
A: 

What to do if it takes around 15 minutes tor un, and This is perfectly fine with the user?

Gabriella