G
Guest
i have a dropdownlist (ddlConsultantCategory) and a textbox (txtRate) that
needs to be synchronized. the dropdownlist shows the "Consultant Category"
and the "Rate" (behaves as if it has 2 columns). when the user makes a
selection in the dropdownlist, txtRate should be populated with the value of
"Rate" which is the same as the 2nd column of the selected item in the
dropdownlist. this seems redundant but unfortunately that's the software
requirement. thanks in advance.
code:
string sCCI = "SELECT activity_no, des1, bill_rate "
+ "FROM pa_activity "
+ "WHERE (activity_no LIKE Upper('D0%') or activity_no LIKE
Upper('S0%')) And last_status <> 'D' "
+ " And activity_type = 'L' "
+ "ORDER BY des1 ";
OracleDataReader oraReader;
OracleConnection oraConn = new OracleConnection(connStr);
OracleCommand oraCMD = new OracleCommand(sCCI, oraConn);
oraConn.Open();
oraReader = oraCMD.ExecuteReader(CommandBehavior.CloseConnection);
while(oraReader.Read())
{
ListItem listItem = new ListItem();
listItem.Text = oraReader.GetString(1).ToString() + " - " +
oraReader.GetInt32(2).ToString();
listItem.Value = oraReader.GetString(1);
ddlConsultantCategory.Items.Add(listItem);
}
oraReader.Close();
oraConn.Close();
needs to be synchronized. the dropdownlist shows the "Consultant Category"
and the "Rate" (behaves as if it has 2 columns). when the user makes a
selection in the dropdownlist, txtRate should be populated with the value of
"Rate" which is the same as the 2nd column of the selected item in the
dropdownlist. this seems redundant but unfortunately that's the software
requirement. thanks in advance.
code:
string sCCI = "SELECT activity_no, des1, bill_rate "
+ "FROM pa_activity "
+ "WHERE (activity_no LIKE Upper('D0%') or activity_no LIKE
Upper('S0%')) And last_status <> 'D' "
+ " And activity_type = 'L' "
+ "ORDER BY des1 ";
OracleDataReader oraReader;
OracleConnection oraConn = new OracleConnection(connStr);
OracleCommand oraCMD = new OracleCommand(sCCI, oraConn);
oraConn.Open();
oraReader = oraCMD.ExecuteReader(CommandBehavior.CloseConnection);
while(oraReader.Read())
{
ListItem listItem = new ListItem();
listItem.Text = oraReader.GetString(1).ToString() + " - " +
oraReader.GetInt32(2).ToString();
listItem.Value = oraReader.GetString(1);
ddlConsultantCategory.Items.Add(listItem);
}
oraReader.Close();
oraConn.Close();