Increase timeout for editor DtResponse
Increase timeout for editor DtResponse

Hi,
I am using datatable editor. Currently the response will return timeout after 30 seconds.
If we use query, we can set the command timeout for the specific command to certain time (example 1 min).
So may I know if it is possible to increase the timeout for specific request for datatable editor.
var settings = Properties.Settings.Default;
var formData = HttpContext.Request.Form;
var conn = ConfigurationManager.ConnectionStrings[settings.DbConnection].ConnectionString;
using (var db = new DataTables.Database(settings.DbType, conn))
{
var response = new Editor(db, "VW000RPTConsignmentTbl", new[] { "CustomerCode", "DeliveryCode", "MaterialCode", "Batch", "SerialNo" })
.Model<VW000RPTConsignmentTbl>()
.Where(q =>
{
if (string.IsNullOrEmpty(materialcode)) return;
q.Where("MaterialCode", materialcode);
})
.Process(formData)
.Data();
JsonNetResult jsonNetResult = new JsonNetResult();
jsonNetResult.Formatting = Formatting.Indented;
jsonNetResult.Data = response;
return jsonNetResult;
}
Thanks and best regards.
This discussion has been closed.
Answers
Hi,
We basically pass the
ajax
object through to jQuery, so you can use the jQuery options as well - e.g.:Allan
Hi,
After I add timeout, the table just keep on loading. However when I debug, the server successfully passing back records. Below is how I Initialise the table.
Are you able to give me a link to the page so I can take a look please?
Thanks,
Allan
Hi Allan,
I am sorry but I am unable to provide you with the link. Just For confirmation, if I set the timeout in ajax, the request should follow the timeout set in ajax? For example if I use sql command, I can set it as below.
Setting:
means the client-side will give the server 60 seconds to response. If it doesn't then the client-side will terminate the connection and throw an error.
If you wanted to add a similar timeout to the SQL command then absolutely you could do that. That makes no difference to DataTables.
Allan