void UpdateAddress() { var img = SupClass.ConvertBitmapSourceToByteArray(new PngBitmapEncoder(), ImageBox.Source); GroupInsertAndAdd(); var con = new SQLiteConnection("Data Source=Address.db; Password=23;"); con.Open(); try { var com = new SQLiteCommand("UPDATE Address_Data SET amails='" + //Name='" + NamesCombo.Text" MailsConvert() + "', photo= @imag, type = '" + GroupCombo.Text + "', member ='" + id + "' where Name='" + NamesCombo.Text + "'", con); com.Parameters.Add(new SQLiteParameter("imag", img)); com.ExecuteScalar(); } catch { MessageBox.Show("Произошла ошибка!"); } con.Close(); Group.Clear(); GetGroups(); }
void AddNewAddress() { var img = SupClass.ConvertBitmapSourceToByteArray(new PngBitmapEncoder(), ImageBox.Source); GroupInsertAndAdd(); var con = new SQLiteConnection("Data Source=Address.db; Password=23;"); con.Open(); var com = new SQLiteCommand("insert into Address_Data (Name, amails, photo, type, member) values ('" + NamesCombo.Text + "', '" + MailsConvert() + "', @imag, '" + GroupCombo.Text + "','" + id + "')", con); com.Parameters.Add(new SQLiteParameter("imag", img)); com.ExecuteScalar(); con.Close(); Group.Clear(); GetGroups(); }
void GetPhoto(byte[] massb) { ImageBox.Source = SupClass.ConvertByteArrayToBitmapImage(massb); }