Hi,
I am working with odbcCommand class, in one case I got error that QueryTimeout Expired. Even though this SP is taking only 3-4 secs in DB to execute these specific values, When I set the CommandTimeout=0, then it worked fine. Kindly help me to know more about this property and please answer my 2 questions.
1)Is it necessary to always use this property while working with Command Class.
2)If it is not suggested to use, but still if I use it then how it will impact the performance.
Kindly response me as soon as possible.
Below is my code sample.
OdbcConnection conObj;
OdbcCommand cmdObj;
OdbcDataAdapter daObj = new OdbcDataAdapter();
public DataTable GetIFAContractNoteData(string RecipientIDIFACN, DateTime BatchDateIFACN, int TransmittalReportIDIFACN)
{
conObj = new OdbcConnection(GlobalVariables.strDsnName + ";" + GlobalVariables.strDsnDataBase + ";" + GlobalVariables.strDsnUserID + ";" + GlobalVariables.strDsnPassword);
conObj.Open();
cmdObj = new OdbcCommand("{call sto_GetIFAContractNote(?,?,?)}", conObj);
cmdObj.CommandTimeout = 0;
cmdObj.CommandType = CommandType.StoredProcedure;
cmdObj.Parameters.AddWithValue("@RecipientID", RecipientIDIFACN);
cmdObj.Parameters.AddWithValue("@BatchDate", BatchDateIFACN);
cmdObj.Parameters.AddWithValue("@TransmittalReportID", TransmittalReportIDIFACN);
cmdObj.ExecuteNonQuery();
daObj.SelectCommand = cmdObj;
dtContractNote = new DataTable();
daObj.Fill(dtContractNote);
return dtContractNote;
}