Hi,
You can checkout below code insted of database connection i created my own collection datasource.
public class Schools
{
public int OfficeID { get; set; }
public String OfficeName { get; set; }
}
protected void Page_Load(object sender, EventArgs e)
{
List<Schools> offices = new List<Schools>{
new Schools{ OfficeID=2, OfficeName="USA"},
new Schools{ OfficeID=4, OfficeName="IND"},
new Schools{ OfficeID=1, OfficeName="SGP"},
new Schools{ OfficeID=3, OfficeName="UK"},
};
drpSchoolOff.DataSource = offices.OrderBy(x => x.OfficeID);
drpSchoolOff.DataValueField = "OfficeID";
drpSchoolOff.DataTextField = "OfficeName";
drpSchoolOff.DataBind();
}