locked
Oracle connection from Asp.net web service RRS feed

  • Question

  • User-482367380 posted

    Hi All,

    I am new to asp.net.

    Just wanted a sample example on how to get connected with oracle database from a client system using asp.net web service

    in VS 2008 vb.net.

    Any tutorials would be a help.

    Thanks all

    Thursday, August 30, 2012 12:46 PM

Answers

  • User-287491473 posted

    I prefer to use ODP.  It follows the ADO.NET standard pretty well.  You can get it for free at Oracle.com.  You need to create a free account though.  The link below is where you can download the ODP DLLs and contains a repository of sample code.  I also put a simple sample below.

    http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

                using (OracleConnection conn = new OracleConnection("User Id=***;Password=***;Data Source=***;Persist Security Info=True;"))
                {
                    conn.Open();
                    OracleCommand cmd = new OracleCommand("SELECT SysDate FROM Dual", conn);
                    Object sysDate = cmd.ExecuteScalar();
                    Response.Write(sysDate);
                }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 30, 2012 5:07 PM