Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-18
3
Medium Priority
?
1,226 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 1000 total points
ID: 34359037
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

963 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