From c5aa5620a171f7d321e68ede7dc1799285ccf83a Mon Sep 17 00:00:00 2001 From: nikita Date: Tue, 26 Dec 2017 13:23:09 +0530 Subject: [PATCH] opening connection before assigning to SQLCommand --- 400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 7128c81..1219f29 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -328,8 +328,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.UPDATE_USER_PASSWORD; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sLoginId", loginId); @@ -483,8 +483,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.UPDATE_LICENSE_TERM_STATUS; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sAccountNumber", accountNumber); @@ -543,8 +543,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.INSERT_LOGIN_DETAIL; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@iUserId", userId); @@ -572,8 +572,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.INSERT_INCORRECT_LOGIN_ATTEMPTS; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@iUserId", userId); @@ -637,8 +637,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.UPDATE_INCORRECT_LOGIN_ATTEMPTS; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@iUserId", userId); @@ -665,8 +665,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.DELETE_INCORRECT_LOGIN_ATTEMPTS; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@iUserId", userId); @@ -724,8 +724,8 @@ namespace AIAHTML5.API.Models { conn = new SqlConnection(dbConnectionString); cmd = new SqlCommand(); - cmd.Connection = conn; conn.Open(); + cmd.Connection = conn; cmd.CommandText = DBConstants.INSERT_LOGIN_ERROR_LOG; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@nvAccountNumber", accountNumber); -- libgit2 0.21.4