Sound test

This commit is contained in:
NBTEMP\bib
2026-09-03 11:31:57 +02:00
parent 4c9cd48ec0
commit d038cd9503
6 changed files with 93 additions and 18 deletions
+24
View File
@@ -80,5 +80,29 @@ namespace Casino
return imageBytes;
}
public byte[] GetSound(int id)
{
byte[] soundBytes = null;
using (MySqlConnection conn = new MySqlConnection(myConnectionString))
{
conn.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT sound FROM Sounds WHERE id = @id",conn))
{
cmd.Parameters.AddWithValue("@id", id);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
soundBytes = (byte[])reader["sound"];
}
}
}
}
return soundBytes;
}
}
}