private void fillCategory() { string Error = ""; DBProduct Obj = new DBProduct(); DataTable table = Obj.getAllCategory(ref Error); comboBox1.DataSource = table; comboBox1.DisplayMember = "CategoryName"; comboBox1.ValueMember = "CategoryId"; }