Im trying to retrieve a query as a byte array. Im stuck @ the code though.
byte[] temp = QueryFile("SELECT modelFile FROM items WHERE modelName='F_Pants1'");
public byte[] QueryFile(string queue)
{
MySqlCommand command = MySqlCon.CreateCommand();
MySqlDataReader Reader;
command.CommandText = queue;
MySqlCon.Open();
Reader = command.ExecuteReader();
byte[] thisrow = new byte[1000];
while (Reader.Read())
{
for (int i = 0; i < Reader.FieldCount; i++)
thisrow[0] = Convert.ToByte(Reader.GetValue(i).ToString());
}
thisrow = thisrow.Remove(thisrow.Length - 1, 1);
MySqlCon.Close();
return thisrow;
}
If anyone has an answer, i would greatly appreciate it.