Hi guys, hey Ive been out of the forums for a long time, also out of programming, but now weve a problem and prolly you know the answer to this
Ive a stored procedure that takes too long to execute, it processes large amounts of information (up to 750 million rows) but when we call it (using the following code) we get a timeout, how can I make my application wait til the procedure is done? also this stored procedure calls 11 user defined functions. If I execute the procedure using Query Analyzer it runs perfectly and I never get a timeout. How can I solve this?
Thanks in advance
Ive a stored procedure that takes too long to execute, it processes large amounts of information (up to 750 million rows) but when we call it (using the following code) we get a timeout, how can I make my application wait til the procedure is done? also this stored procedure calls 11 user defined functions. If I execute the procedure using Query Analyzer it runs perfectly and I never get a timeout. How can I solve this?
Code:
string sDate = "20041130"; string sLastDate ="20041031";
string sConnect = "server=--;UID=--;PWD=--;DATABASE=--;";
SqlConnection Conn = new SqlConnection(sConnect);
SqlCommand ObjCmd = new SqlCommand("sp_inv",Conn);
ObjCmd.CommandType = CommandType.StoredProcedure;
SqlParameter DateParam = new SqlParameter("@DATE",sDate);
ObjCmd.Parameters.Add(DateParam);
SqlParameter LastDateParam = new SqlParameter("@LASTDATE",sLastDate);
ObjCmd.Parameters.Add(LastDateParam);
try
{
Conn.Open();
ObjCmd.ExecuteNonQuery();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
Conn.Close();
Conn.Dispose();
}
Thanks in advance