?
Solved

calling a Oracle Stored procedure ASP.net(pls see the following code and help me to find the mistake)

Posted on 2003-03-24
10
Medium Priority
?
335 Views
Last Modified: 2010-04-15


CREATE OR REPLACE PACKAGE PackgeTEST AS
TYPE cursemp IS REF CURSOR RETURN emp%ROWTYPE;
PROCEDURE emptest
(pename IN varchar2, pemp OUT cursemp);
END  PackgeTEST;
/
CREATE OR REPLACE  PACKAGE BODY PackgeTEST AS
PROCEDURE emptest
(pename IN varchar2, pemp OUT cursemp)
AS
BEGIN
Open pemp for Select * from emp where ename = pename;
     END;
     END;
/





public void storedpro()
          {
          string strconn;
          strconn="Data Source= udhanth; User  
                ID=scott;Password=tiger";
          OracleConnection cn= new OracleConnection(strconn);
          cn.Open();
          string strSQL="PackgeTEST.emptest";
          OracleCommand cmd= new OracleCommand(strSQL,cn);
          cmd.CommandType= CommandType.StoredProcedure;
          OracleParameter param;
          param=cmd.Parameters.Add("pename",OracleType.VarChar,10);
          param.Value="KING";
          param=cmd.Parameters.Add("pemp",OracleType.Cursor);
          param.Direction=ParameterDirection.Output;
          OracleDataAdapter da = new OracleDataAdapter(cmd);
          DataSet ds = new DataSet();
          da.Fill(ds);
          DataGrid1.DataSource=ds;
          DataGrid1.DataBind();
          cn.Close();

          }
0
Comment
Question by:mallasani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
10 Comments
 

Expert Comment

by:ACGT
ID: 8200883
Hi mallasani,

Can you give us the components you are using (Namespace for "OracleCommand??).

We try the same (C# + Oracle db), maybe we can help each other.

Sabine
0
 

Author Comment

by:mallasani
ID: 8203459
hello,
i am using microsoft provider for oracle.
using System.Data.OracleClient.
any help is really appreciated, i am having problem with this problem, i'll be happy share whatever i know.
thanks
ramana
0
 
LVL 3

Expert Comment

by:RiverGuy
ID: 8207223
The MS Provider for Oracle never worked right for me in VB6.  The Oracle provider worked better.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
ACGT earned 800 total points
ID: 8216446
Hi mallasani,

tried to follow your code, but my Visual Studio can't find the function:

DataGrid1.DataBind();

If I comment this line and go to end, it works fine and I can explore "table" in the datagrid where I than see the one row with the correct data.

So, what special kind of error do you get?

Sabine
0
 

Expert Comment

by:ACGT
ID: 8216866
Sorry, I forgot to mention that I also use the original Oracle Provider and not MS Provider!

Sabine
0
 

Expert Comment

by:ACGT
ID: 8282435
Hi Mallasani, are you still living?
Give a sign, if it works now!

Sabine
0
 

Author Comment

by:mallasani
ID: 8304704
hi Sabine,
Sorry, I was busy with things, anyway i solved the problem, it was nothing to do with provider, the problem was, the wrong code in the microsoft published book.
thanks though
ramana
0
 

Expert Comment

by:ACGT
ID: 8341085
Hi Ramana,

I think, you should accept my comment as answer, as I found exactly the error:
the wrong line in your code.
Would be nice for me and it doesn't hurt you :-)

Sabine
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 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