private void btn_Send_Click(object sender, EventArgs e) { if (validationAddField() == false) { } else { ImageConverter image = new ImageConverter(); byte[] img = (byte[])image.ConvertTo(pictureBox1.Image, Type.GetType("System.Byte[]")); expense.ExpName = txt_ExpenseName.Text; expense.ExpTotal = Math.Round(total, 2); expense.ExpCategory = cb_Category.Text; expense.ReceiptNo = receiptRefNo; expense.receiptDate = dateTimePicker1.Value; expense.Image = img; int numRes = add.AddNEwExpense(expense); if (numRes > 0) { MessageBox.Show("Record added successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); dg_ExpenseData.Update(); dg_ExpenseData.Refresh(); clearFields(); dg_ExpenseData.DataSource = fetchData.FetchAllExpensesRecords(expense); dg_ExpenseData.Columns[2].DefaultCellStyle.Format = "C2"; } } }