public Form1(int UserId) { this.UserId = UserId; InitializeComponent(); GetEmployees = StaffDAL.GetEmployees(); bindingSource = new BindingSource(GetEmployees, null); dataGridView1.DataSource = bindingSource; this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; }
public static DatabaseDataSet.GetEmployeesDataTable GetEmployees() { DatabaseDataSet.GetEmployeesDataTable getEmployees = new DatabaseDataSet.GetEmployeesDataTable(); using (Database.GetConnection()) { DatabaseDataSetTableAdapters.GetEmployeesTableAdapter getEmployeesTableAdapter = new DatabaseDataSetTableAdapters.GetEmployeesTableAdapter(); getEmployeesTableAdapter.Fill(getEmployees); } return(getEmployees); }
private void btnRefresh_Click(object sender, EventArgs e) { GetEmployees = StaffDAL.GetEmployees(); bindingSource = new BindingSource(GetEmployees, null); dataGridView1.DataSource = bindingSource; }