private void cbSupplier_SelectedIndexChanged(object sender, EventArgs e) { if (cbSupplier.SelectedIndex != -1) { Inventory inventory = new SCANINOUTBL.Inventory(); dgvData.AutoGenerateColumns = false; dgvData.DataSource = inventory.GetReorderQty(cbSupplier.SelectedValue.ToString(), cbDays.Text == "" ? "0" : cbDays.Text, out listoflocalSKU); } }