/// <summary> /// Function to fill datagridview /// </summary> public void GridFill() { try { ProductSP spProduct = new ProductSP(); ProductInfo infoProduct = new ProductInfo(); int inSelect = 0; if (cmbSearchBy.SelectedIndex == 0) { infoProduct.GroupId = Convert.ToInt32(cmbProductGroupTax.SelectedValue.ToString()); } else { inSelect = 1; infoProduct.TaxId = Convert.ToInt32(cmbProductGroupTax.SelectedValue.ToString()); } infoProduct.ProductCode = txtProductCode.Text.Trim(); infoProduct.ProductName = txtProductName.Text.Trim(); DataTable dtbl = spProduct.ChangeProductTaxSearch(infoProduct, inSelect); dgvChangeProductTax.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("CPT 6 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }