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:

<aspTongue Tiedqldatasource 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>
</aspTongue Tiedqldatasource>

@Title does not work with an Oracle datasource via ODBC (ORA-00936 missing expression). I tried to remove it:

<aspTongue Tiedqldatasource 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>
</aspTongue Tiedqldatasource>

I get no error but it does not work. I tried to use a colon :

<aspTongue Tiedqldatasource 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>
</aspTongue Tiedqldatasource>

I get the following error:

ORA-01745: invalid host/bind variable name

What is the correct syntax?

Thanks in advance.

Phil

indicium@msn.com

[4038 byte] By [Indicium] at [2008-1-4]

.NET Development

Site Classified