This commit is contained in:
2026-03-06 17:58:48 +08:00
parent 393e451064
commit adedb7e83d
102 changed files with 13691 additions and 271 deletions
+34
View File
@@ -422,6 +422,40 @@ namespace BLL
}
}
/// <summary>
/// 执行SQL语句
/// </summary>
/// <param name="sql">sql语句</param>
public static bool ExecuteSql(string sql)
{
bool result = false;
using (SqlConnection Connection = new SqlConnection(connectionString))
{
try
{
result = true;
Connection.Open();
SqlCommand command = new SqlCommand(sql, Connection)
{
CommandTimeout = 0,
CommandType = CommandType.Text
};
command.ExecuteNonQuery();
}
catch (Exception ex)
{
result = false;
ErrLogInfo.WriteLog($"【执行SQL语句报错】{sql};【错误信息】{ex.Message}");
}
finally
{
Connection.Close();
}
return result;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Creates a DataSet by running the stored procedure and placing the results