MKItani
asked on
select query+time out+C#+window application
I am using a sqltableadpater as follows:
SqlTableAdpatper.Fill(data set.table) ;
and when i am using this code i get an error, the meaning of the error is (query time out)
and what i know is that query needs a lot of time about 3 minutes.
how i can solved this problem?
SqlTableAdpatper.Fill(data
and when i am using this code i get an error, the meaning of the error is (query time out)
and what i know is that query needs a lot of time about 3 minutes.
how i can solved this problem?
change the execution timeout value of your command to a greater value.
ASKER
how i can do it?
You surely have a Command object (would be easier if you could show your code).
Set the CommandTimeOut property of your command to a value greater then 180 (which is in seconds). Check http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx
Set the CommandTimeOut property of your command to a value greater then 180 (which is in seconds). Check http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you a lot.
so i will use SetCommandTimeOut()
but i am still confused in 2 issues and i hope to help me also.
i read that the CommandTimeout is The time in seconds to wait for the command to execute.
but my question is as follows :
is even the sql server begin the execution of the query and before to the sql server locate all the rows if the consuming time is greater than the "command time out" we get the also the above error.
or the "CommandTimeout" is just the consumed time before the sql server began to execute the command?
so i will use SetCommandTimeOut()
but i am still confused in 2 issues and i hope to help me also.
i read that the CommandTimeout is The time in seconds to wait for the command to execute.
but my question is as follows :
is even the sql server begin the execution of the query and before to the sql server locate all the rows if the consuming time is greater than the "command time out" we get the also the above error.
or the "CommandTimeout" is just the consumed time before the sql server began to execute the command?
the commandtimeout is the time required by your application to receive all the data (so the time of the SQL server + latency time)