I have a file I converted into one long string. I want to take that string, convert it to a array of bytes then upload it to my database. However, when i run my code, it shows up in the database as NULL;
Here's my code:
SQL.UploadFile(Encoding.ASCII.GetBytes(FBX), txt_Name.Text);
public void UploadFile(byte[] value, string Where)
{
const string SQL = "UPDATE itemmodel SET modelFile='@File' WHERE modelName='@Name'";
MySqlCommand cmd = new MySqlCommand(SQL, MySqlCon);
cmd.Parameters.AddWithValue("@File", value);
cmd.Parameters.AddWithValue("@Name", Where);
MySqlCon.Open();
cmd.ExecuteNonQuery();
MySqlCon.Close();
}