Solved

Setting the BindByName when using Oracle.DataAccess.Client with a Microsoft asp:SqlDataSource control

Posted on 2010-11-18
3
1,118 Views
Last Modified: 2012-10-06
I have a Microsoft asp:SqlDataSource control on my ASP.net page.  In the SelectCommand, I use Bind variables.

My problem is that when I coded the page using the Microsoft provider (System.Data.OracleClient), the bind variables are bound by name.  Now I want to switch to the Oracle provider (Oracle.DataAccess.Client) and the bind variables are bound by position.  I have hundreds of pages with these controls, so I do not want to have to recode each page.

So how do I set the Oracle provider (Oracle.DataAccess.Client) to use the Bind by Name.

Here is a sample of my code, as it works with the Microsoft provider.

<asp:SqlDataSource ID="SqlDSf2" runat="server" ConnectionString="<%$ ConnectionStrings:isafedata.corractions %>" ProviderName="<%$ ConnectionStrings:isafedata.corractions.ProviderName %>" 
SelectCommand="
        SELECT RL_ID_PK, RL_REGION FROM REGION_L, SYSTEM_CHARACTERISTICS, USER_STORE
        WHERE /* LSQL_AUTH('RL_ID_PK', :fldparmUserID ,RL_ID_PK)=1  */ :fldparmUserID = :fldparmUserID and   region_l.ARCHIVE_REC = 0
        and RL_ID_PK = SYSC_REGION
        AND US_USER = :fldparmUserID
        AND (SYSC_BUSINESS_GROUP = :parmf1 OR :parmf1 = '0')
        AND (sysc_business_group = US_BUSINESS_GROUP or US_BUSINESS_GROUP = '0')
        AND (sysc_region = us_region OR us_region = '0')
        union select 0, ' All'     from dual  ORDER BY RL_REGION
      "> 
<SelectParameters>
 <asp:ControlParameter ControlID="drdf1"  DefaultValue="all" Name="parmf1"  PropertyName="SelectedValue" />
 <asp:ControlParameter ControlID="GVTxtUserID"  DefaultValue="all" Name="fldparmUserID"  PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>

Open in new window


The web.config contains the ConnectionStrings:isafedata.corractions information.
0
Comment
Question by:photostephen
3 Comments
 
LVL 14

Accepted Solution

by:
raja_ind82 earned 250 total points
ID: 34359037
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now