Problem
update image based on UserID not saved in database access 2007
I need to update field qrimg in access 2007 database
Based on field UserID with datatype text
AllPrinting table have two fields UserID,qrimg
and qrimg with datatype OleObject
my code with c# windows form application c# vs 2015
under button i write
- byte[] buffer = File.ReadAllBytes(path);
- OleDbConnection oleDbConnection = new OleDbConnection(connection);
- string str = "Update AllPrinting set qrimg=@qrimg where UserID=@UserID"; OleDbCommand oleDbCommand = new OleDbCommand(); oleDbConnection.Open();
- oleDbCommand.Connection = oleDbConnection; oleDbCommand.CommandText = str; oleDbCommand.Parameters.AddWithValue("@UserID", label4.Text);
- byte[] yourPhoto = buffer; oleDbCommand.Parameters.AddWithValue("@qrimg", yourPhoto);
- using (oleDbConnection)
- {
- oleDbCommand.ExecuteNonQuery();
- }
- oleDbConnection.Close();
when press button to execute code above not exception show
and also no update to image in access done
so that what is the problem
when i press button i add two message box to path and label4 and all both have values