public static void LoadDesignation(this DropDownList ddl, int CompanyId) { DataTable dt = Designation.GetDesignation(CompanyId); ddl.Items.Clear(); ddl.Items.Add(new ListItem("--select--", "0")); if (dt != null) { foreach (DataRow item in dt.Rows) { ddl.Items.Add(new ListItem(item["Designation"].ToString(), item["Designation_Id"].ToString())); } } }