I'm getting the exception:
ORA-00907: missing right parenthesis
Code:
string sCCI = "SELECT activity_no, (des1 title + '-' + bill_rate) category "
+ "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 ";
OracleConnection oraConn = new OracleConnection(connStr);
OracleCommand oraCMD = new OracleCommand(sCCI, oraConn);
oraConn.Open();
OracleDataAdapter adapter = new OracleDataAdapter(oraCMD);
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
ddlConsultantCategory.DataSource = ds.Tables[0];
ddlConsultantCategory.DataTextField = "category";
ddlConsultantCategory.DataValueField = "title";
ddlConsultantCategory.DataBind();
ddlConsultantCategory.Items.Insert(0, "(Select Consultant Category)");
}
oraConn.Close();
"Sanjay Pais" wrote:
First off, your your property settings seem to be incorrect:
ddlConsultantCategory.DataTextField = "category";
ddlConsultantCategory.DataValueField = "category";
The data Text field seems to be the same as the DataValue field.
Secondly change you SQL to Select the Title and Billing Rate into a single
column and set this as the DataTextField. You can then set some other unique
column as the datavalue field
Sanjay
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...I need to populate a dropdownlist that will show two entries (title and
billing rate) for each item. Example:
Programmer $50
Engineer $50
...
Right now I'm only able to show the title but not the rate. My code
follows:
sCCI = "SELECT activity_no,des1 category,Convert(activity_uom,'US7ASCII')
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 ";
OracleConnection oraConn = new OracleConnection(connStr);
OracleCommand oraCMD = new OracleCommand(sCCI, oraConn);
oraConn.Open();
OracleDataAdapter adapter = new OracleDataAdapter(oraCMD);
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
ddlConsultantCategory.DataSource = ds.Tables[0];
ddlConsultantCategory.DataTextField = "category";
ddlConsultantCategory.DataValueField = "category";
ddlConsultantCategory.DataBind();
ddlConsultantCategory.Items.Insert(0, "(Select Consultant Category)");
}
oraConn.Close();