selectparameters with an Oracle datasource via ODBC
Hello,
VS 2005/.NET2.0/Oracle DB via ODBC (System.Data.Odbc)
I am trying to add a select parameter to a SQLDataSource. With SQLServer, the code would be:
<asp
qldatasource id="SqlDataSource1"runat="server"
connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
selectcommand="SELECT LastName FROM Employees WHERE Title = @Title">
<selectparameters>
<asp:controlparameter name="Title" controlid="DropDownList1" propertyname="SelectedValue"/>
</selectparameters>
</asp
qldatasource>
@Title does not work with an Oracle datasource via ODBC (ORA-00936 missing expression). I tried to remove it:
<asp
qldatasource id="SqlDataSource1"runat="server"
connectionstring="<%$ ConnectionStrings:MyOracleDB%>"
selectcommand="SELECT LastName FROM Employees WHERE Title = Title">
<selectparameters>
<asp:controlparameter name="Title" controlid="DropDownList1" propertyname="SelectedValue"/>
</selectparameters>
</asp
qldatasource>
I get no error but it does not work. I tried to use a colon :
<asp
qldatasource id="SqlDataSource1"runat="server"
connectionstring="<%$ ConnectionStrings:MyOracleDB%>"
selectcommand="SELECT LastName FROM Employees WHERE Title = :Title">
<selectparameters>
<asp:controlparameter name="Title" controlid="DropDownList1" propertyname="SelectedValue"/>
</selectparameters>
</asp
qldatasource>
I get the following error:
ORA-01745: invalid host/bind variable name
What is the correct syntax?
Thanks in advance.
Phil

