private void ShowAllSupplierData() { try { dataGridViewSuppliers.Rows.Clear(); var suppliers = SupplierDataAccess.GetAllSuppliers(); foreach (var supplier in suppliers) { int rowId = dataGridViewSuppliers.Rows.Add(); DataGridViewRow row = dataGridViewSuppliers.Rows[rowId]; row.Cells["Id"].Value = supplier.Id; row.Cells["Username"].Value = supplier.Username; row.Cells["RealName"].Value = supplier.Real_Name; row.Cells["PasswordHash"].Value = supplier.Password_Hash; row.Cells["PhoneNumber"].Value = supplier.Phone_Number; row.Cells["EmailAddress"].Value = supplier.Email_Address; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }