This commit is contained in:
jackchenyang
2024-05-23 20:10:26 +08:00
parent 9db2db1ad1
commit 1dcadf1a61
4 changed files with 47 additions and 5 deletions
+5 -2
View File
@@ -971,7 +971,7 @@ namespace BLL
return maxId;
}
public static int getIntValue(string sql)
public static int getIntValue(string sql, SqlParameter[] param=null)
{
int i = 0;
using (SqlConnection Connection = new SqlConnection(connectionString))
@@ -981,7 +981,10 @@ namespace BLL
Connection.Open();
SqlCommand command = new SqlCommand(sql, Connection);
command.CommandType = CommandType.Text;
if (param != null)
{
AddParameterToCommand(command, param);
}
i = Convert.ToInt32(command.ExecuteScalar());
}
finally