Sound test
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user