habib ullah

habib ullah

  • NA
  • 229
  • 14.2k

my dropdrown is not loaded in the data is already datatable

Feb 28 2018 12:08 AM
if (cmb_supply.Text != null)
{
try
{
List<SqlParameter> prm = new List<SqlParameter>();
DataSet ds = sp.GetDS("sp_GetSupplier", prm);
DataTable dt = ds.Tables[0];
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
cmb_supply.DisplayMember = "Name";
cmb_supply.ValueMember = "SupplierId";
}
}
catch (Exception ex)
{
throw ex;
}

Answers (2)