473,659 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.net/oracle multiple select parameter problem

1 New Member
Environment: .net2.0 over oracle

Problem? a simple select statement within a DetailsView that gets two parameter values from a GridView SelectedValue.

It might be valuable to understand that to pull a single record from this particular table requires two parameters.

What follows defies understanding.

The desired query:
<asp:SqlDataSou rce .....
SelectCommand=" select * from tbl where col1 = :x AND col2 = :y"
....
<asp:ControlPar ameter ControlID="Grid View1" Name="x" PropertyName="S electedValue" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1" Name="y" PropertyName="S electedValue" Type="String" />
....
</asp:SqlDataSour ce>

Returns nothing, no response, nada, zero - though the values are plainly visible in GridView1.

A modification to try to see what's happening:
<asp:SqlDataSou rce .....
SelectCommand=" select * from tbl where col1 = :x OR col2 = :y"
....
<asp:ControlPar ameter ControlID="Grid View1" Name="x" PropertyName="S electedValue" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1" Name="y" PropertyName="S electedValue" Type="String" />
....
</asp:SqlDataSour ce>

Changing the AND to OR returns just what the query asks for - way much more than the one record desired, but it works.

Another modification to try figure out what's happening:
<asp:SqlDataSou rce .....
SelectCommand=" select * from tbl where col1 = 'x' or col2 = 'y'"
....
</asp:SqlDataSour ce>

Hard coding the values returns the desired record.

Why do the multilple selectparameter s (AND) cause the query to get lost in .net?

Hard coding it in code-behind also works, but bypasses all the .net classes and makes for a ton of coding when updating, deleting and inserting and all their parameters need to be coded in. It would be good to just see .net to it's job.

This is just one query of hundreds in this application and all work if a single select parameter is used (can be used). The problem appears only when more than one select parameter is needed to return a record. Then you get nothing.

I am stumped.

If this is not the correct forum, please give directions.
Dec 29 '06 #1
1 5170
rengaraj
168 New Member
What is the table structure?
What is the data type of the two columns in the Oracle table?
Feb 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
40249
by: francis70 | last post by:
Hi, I have these 2 problem? Is there a way in Oracle to read UNCOMMITED data. i.e. in Oracle the normal behaviour is that a user's updates to a table are visible to other users ONLY when the user commits. But in Informix there is this thing called ISOLATION LEVELS. For example by setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data, i.e. the last uncommited updated value of a field by some other user. Is
4
19986
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
2
12509
by: Dmitry Bond. | last post by:
Hello All. Currently we are porting some software from NSK (HP Hon-Stop) SQL to Oracle and I faced with the following problem... The SQL statement: select * from BOM where ordnr = :1 where value of parameter ":1" is "ORD195" returns no data (sqlcode 1403). But the SQL:
4
7228
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript to make ODBC calls to the db. The particular system I'm working with, will not work with an Oracle stored procedure I'm told. However, it
0
3019
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The open questions: How to display a resultset
2
2131
by: guanfenglin | last post by:
Hello, I have a grid view which display and updates the data, however it doesn't work well, I always either get invalid name/number or not all varaibles bound, I am very frustrated at the moment. Thank you very much!! Here is the gridview code:
5
7543
by: ashley.ward | last post by:
I am attempting to write a program with VB 2005 Express Edition which accesses an Oracle 9 database and dumps the results of three SELECT queries into a spreadsheet file once every hour. Modifications will be being made to the database whilst this program is running. I would like the three queries to each give data relating to the same point in time, despite the fact they actually run in sequence. In Oracle's sqlplus tool, I can use...
7
20318
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
2
14230
by: Vinod Sadanandan | last post by:
All, Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze each of the listed features . Precompilers: Additional Array INSERT and SELECT Syntax Support by Pro*C/C++ and Pro*COBOL Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL Precompilers: Flexible B Area Length...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.