I have a sqlServer problem in my .net MVC application
Well the error is thrown from the da.fill(ds) line :
cmd = new SqlCommand(req, con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
return ds;
and this is the error :
The turnaround time has expired. The timeout elapsed before the end of the operation or the server does not respond. '
System.Data.SqlClient.SqlException
HResult = 0x80131904
Message = The execution time has expired. The timeout elapsed before the end of the operation or the server does not respond.
Source = .Net SqlClient Data Provider
Procedure tree:
<Can not Evaluate Exception Procedure Call Tree>
Well i found the main problem and it is an sql request :
SELECT *
from Nbre_enq_livreur
where (nb_enq >= 3) and T_PHONET = 207 and t_groupement = 25
GROUP BY T_PHONET,livreur,Init_Maglivreur,nb_enq,t_groupement
Well it is correct but t_groupement and t_phonet don't want to work togther
I waited for 15 min and still circuling wwhen launching the request in MSMS
Any help and ty
If your query needs more than the default 30 seconds, you might want to set the CommandTimeout higher. To do that you'll change it after you instantiated the DataAdapter on the SelectCommand property of that instance, like so:
//set the CommandTimeout
da.SelectCommand.CommandTimeout = 60; // seconds
Code will be
cmd = new SqlCommand(req, con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.SelectCommand.CommandTimeout = 60; // seconds
da.Fill(ds);
return ds;
User contributions licensed under CC BY-SA 3.0