D
dungdang
Hello,
I want to add a new row on top of the list retrieved from a database
table..aparantely the it can retirne the list from a table but can't
add the new row as indicated below..what should I do? or is there any
other way to this rather.
dungdang,
=========================CODE START=================
objConnection = new SqlConnection(strConnection);
objConnection.Open();
string strSelect = "SELECT staff_id, staff_l_name FROM
Faculty_Staff_Details";
objCommand3 = new SqlCommand(strSelect,
objConnection);
objDataReader3 = objCommand3.ExecuteReader();
drpStaff.DataSource = objDataReader3;
drpStaff.DataTextField = "staff_l_name";
drpStaff.DataValueField = "staff_id";
ListItem liItem = new ListItem("Vacant", "Vacant");
drpStaff.Items.Insert(0, liItem);
drpStaff.Items.Add(liItem);
drpStaff.DataBind();
objDataReader3.Close();
=====================CODE END=============================
I want to add a new row on top of the list retrieved from a database
table..aparantely the it can retirne the list from a table but can't
add the new row as indicated below..what should I do? or is there any
other way to this rather.
dungdang,
=========================CODE START=================
objConnection = new SqlConnection(strConnection);
objConnection.Open();
string strSelect = "SELECT staff_id, staff_l_name FROM
Faculty_Staff_Details";
objCommand3 = new SqlCommand(strSelect,
objConnection);
objDataReader3 = objCommand3.ExecuteReader();
drpStaff.DataSource = objDataReader3;
drpStaff.DataTextField = "staff_l_name";
drpStaff.DataValueField = "staff_id";
ListItem liItem = new ListItem("Vacant", "Vacant");
drpStaff.Items.Insert(0, liItem);
drpStaff.Items.Add(liItem);
drpStaff.DataBind();
objDataReader3.Close();
=====================CODE END=============================