There is a program that encrypts passwords using AES. This encryption algorithm uses byte arrays. I write down the key and initialization vector (IV) in the OLE field and they seem to be stored there, but when I try to retrieve the data, an error pops up.
public byte[] GetKeyFromKeyTable(int ID) { byte[] Key; DataTable stor = new DataTable(); string sql = string.Format("Select [EKey] From [KeyTable] Where [Id_Auth] = '{0}'", ID); using (OleDbCommand cmd = new OleDbCommand(sql, this.connect)) { OleDbDataReader dr = cmd.ExecuteReader(); stor.Load(dr); dr.Close(); Key = (byte[])stor.Rows[0][0]; } return Key; } System.Data.OleDb.OleDbException not processed ErrorCode = -2147217913 HResult = -2147217913 Message = Data type mismatch in the selection condition expression. Source = Microsoft JEET Object & executeResult) in System.Data.OleDb.OleDbCommand.ExecuteCommand (CommandStream (34), e ior h h av av behavior ior ior, Object & executeResult) in the System.Data.OleDb.OleDbCommand.ExecuteReaderInternal (CommandBehavior behavior, String method) in the System.Data.Ole 5 (oStartReaderInternal) (CommandBehavior behavior, String method) in System.Data.Ole (18) ) in System.Data.OleDb.OleDbCommand.ExecuteReader () in master_password.DBase.GetKeyFromKeyTable (Int32 ID) in C: \ Users \ rmatu \ Desktop \ PasswordStorage \ PasswordStorage \ DBase.cs: string 336 in PasswordStorage.Main.Main_Load ( Object sender, EventArgs e) in C: \ Users \ rmatu \ Desktop \ PasswordStorage \ PasswordStorage \ Main.cs: line 86 in System.Windows.Forms.Form.OnLoad (EventArgs e) in MetroFramework.Forms.Metro Form.OnLoad (EventArgs e) in System.Windows.Forms.Form.OnCreateControl () in System.Windows.Forms.Control.CreateControl (Boolean fIgnoreVisible) in System.Windows.Forms.Control.CreateControl () in System.Windows. Forms.Control.WmShowWindow (Message & m) in System.Windows.Forms.Control.WndProc (Message & m) in System.Windows.Forms.ScrollableControl.WndProc (Message & m) in System.Windows.Forms.Form.WmShowWindow (Message & m ) in System.Windows.Forms.Form.WndProc (Message & m) in MetroFramework.Forms.MetroForm.WndProc (Message & m) in System.Windows.Forms.Control.ControlNativeWindow.OnMessage (Message & m) in System.Windows.Forms. Control.ControlNativeWindow.WndProc (Message & m) in System.Windows.Forms.NativeWindow.DebuggableCallback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:
