Click here to Skip to main content
15,919,434 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
please i need help about calling function from C# method ..
i have this function

<br />
ACC.GET_WAFR_FROM_DETAIL<br />
  ( LOC     VARCHAR2,<br />
    BDGYYY  VARCHAR2,<br />
    ACC1    VARCHAR2,<br />
    ACC2    VARCHAR2,<br />
    ACC3    VARCHAR2,<br />
    ACC4    VARCHAR2) RETURN  NUMBER IS<br />


i need to call it from oracleDataAdapter and thanks
Posted

Go through the link below,
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/dotnet/getstarted-c/getstarted_c_otn.htm[^]

This is as simple as using SqlDataAdapter for Sql Server.

Hope this helps.
cheers
 
Share this answer
 
You need to follow the same steps which you used to follow while calling the SP from sql. You can call a oracle function like this:

C#
using (OracleConnection con = new OracleConnection("Data Source=Test;User Id=Test;Password=Test;"))
{
    con.Open();
    OracleCommand cmd = new OracleCommand("ACC.GET_WAFR_FROM_DETAIL");
    cmd.CommandType = System.Data.CommandType.StoredProcedure;
    //Add your parameters here
    cmd.Connection = cnn;
    OracleDataReader odr = cmd.ExecuteReader();
    while (odr.Read())
    {
        Console.WriteLine(odr.GetOracleValue(0));
    }
    Console.ReadLine();
}


--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900