I am trying to retrieve a blob that i have stored in the database. I would then like to store it locally on my pc. ive got this far, but i`m stuck for some time now. can anybody helpt me realise this?
private void button1_Click(object sender, EventArgs e)
{
string myConnection = "datasource=localhost;port=3306;username=root;password=";
MySqlConnection myConn = new MySqlConnection(myConnection);
//
MySqlCommand SelectCommand = new MySqlCommand("select template from csharp.members where username='" +
this.user_txt.Text + "' and password = '" +
this.password_txt.Text + "' ; ", myConn);
MySqlDataReader myReader;
myConn.Open();
myReader = SelectCommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 1)
{
byte[] tmp = (byte[])(myReader["template"]); // need to save this locally
}
}