Added Command Timeout to each query that did not have a specified timeout

This commit is contained in:
Rich
2017-03-01 15:42:00 +00:00
parent b5f4a0751e
commit 32cf8e2f3c
49 changed files with 315 additions and 0 deletions

View File

@@ -627,6 +627,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "getSession";
cm.Parameters.AddWithValue("@SessionID", criteria.SessionID);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
@@ -686,6 +687,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "addSession";
// Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@UserID", _UserID);
@@ -727,6 +729,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "addSession";
// Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@UserID", userID);
@@ -791,6 +794,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "updateSession";
// All Fields including Calculated Fields
cm.Parameters.AddWithValue("@SessionID", _SessionID);
@@ -843,6 +847,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "updateSession";
// Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@SessionID", sessionID);
@@ -885,6 +890,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteSession";
cm.Parameters.AddWithValue("@SessionID", criteria.SessionID);
cm.ExecuteNonQuery();
@@ -907,6 +913,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteSession";
// Input PK Fields
cm.Parameters.AddWithValue("@SessionID", sessionID);
@@ -959,6 +966,7 @@ namespace VEPROMS.CSLA.Library
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "existsSession";
cm.Parameters.AddWithValue("@SessionID", _SessionID);
int count = (int)cm.ExecuteScalar();