private void loadCategory() { DataTable dt = blcat.gellAllCategory(); if (dt.Rows.Count > 0) { dataGridView1.DataSource = dt; } }
private void LoadCategory() { DataTable dt = blc.gellAllCategory(); if (dt.Rows.Count > 0) { DataRow dr = dt.NewRow(); dr["CategoryName"] = "Choose Category"; dt.Rows.InsertAt(dr, 0); cmbCategory.DataSource = dt; cmbCategory.DisplayMember = "CategoryName"; cmbCategory.ValueMember = "CategoryId"; } }