Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Oracle Dbase By c#

Oracle Dbase By c#

Scheduled Pinned Locked Moved Database
csharpdatabaseoraclecomhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    unitecsoft
    wrote on last edited by
    #1

    Hi I have an application where I have to open oracle database read some data and update the tables using C# and ADO.Net . I will use OLE Oracle connection for that . The problem is that I have no Idea about oracle , never used it . How are oracle files named , what are the parameteres I have to pass in my connection to be able to open the Oracle database , access the tables then update it again . " We have either to find a way , or make one " Hanipal Dean

    C 1 Reply Last reply
    0
    • U unitecsoft

      Hi I have an application where I have to open oracle database read some data and update the tables using C# and ADO.Net . I will use OLE Oracle connection for that . The problem is that I have no Idea about oracle , never used it . How are oracle files named , what are the parameteres I have to pass in my connection to be able to open the Oracle database , access the tables then update it again . " We have either to find a way , or make one " Hanipal Dean

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      Here is a bit to get you started.

      OracleConnection dbConn;
      dbConn = new OracleConnection( "DataSource=NameOfDatabase; User ID=USERID; Password=PASSWORD" );
      dbConn.Open()

      To execute a query, try

      string SomeSelect( "select sysdate from dual" );
      OracleCommand command = new OracleCommand ( SomeSelect, dbConn);
      OracleDataReader query = command.ExecuteReader();

      query.Read();

      DateTime DBDateTime = query.GetDateTime(0);

      Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler

      U 1 Reply Last reply
      0
      • C Chris Meech

        Here is a bit to get you started.

        OracleConnection dbConn;
        dbConn = new OracleConnection( "DataSource=NameOfDatabase; User ID=USERID; Password=PASSWORD" );
        dbConn.Open()

        To execute a query, try

        string SomeSelect( "select sysdate from dual" );
        OracleCommand command = new OracleCommand ( SomeSelect, dbConn);
        OracleDataReader query = command.ExecuteReader();

        query.Read();

        DateTime DBDateTime = query.GetDateTime(0);

        Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler

        U Offline
        U Offline
        unitecsoft
        wrote on last edited by
        #3

        Ome more small quastion , ( DataSource=NameOfDatabase ) In oracle file , what would be the NameOfDatabase file extention is it *****.OEA or what extention ? We will either Find a Way , Or Make One ! Hanipal Dean

        C 1 Reply Last reply
        0
        • U unitecsoft

          Ome more small quastion , ( DataSource=NameOfDatabase ) In oracle file , what would be the NameOfDatabase file extention is it *****.OEA or what extention ? We will either Find a Way , Or Make One ! Hanipal Dean

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #4

          This stuff is still going to depend upon Oracle client being installed. When you install Oracle client, it typically will walk through an initial network setup of a remote database. During this setup, you will need to provide the local name that defines the remote database. It is this local name that you provide as 'NameOfDatabase'. It is not a file name or anything like that. I have used this code to connect to both Oracle 8 and Oracle 9 databases. While I haven't tried specifically with an Oracle 7 database, I would expect that it would still connect okay. Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler

          U 1 Reply Last reply
          0
          • C Chris Meech

            This stuff is still going to depend upon Oracle client being installed. When you install Oracle client, it typically will walk through an initial network setup of a remote database. During this setup, you will need to provide the local name that defines the remote database. It is this local name that you provide as 'NameOfDatabase'. It is not a file name or anything like that. I have used this code to connect to both Oracle 8 and Oracle 9 databases. While I haven't tried specifically with an Oracle 7 database, I would expect that it would still connect okay. Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler

            U Offline
            U Offline
            unitecsoft
            wrote on last edited by
            #5

            Talking about oracle versions , is there a major difference in operation between Oracle 8 and oracle 9 . If I am going to start learning oracle fresh , is it better to start with 8 or 9 . We will either find a way or make one ! Hanipal Dean

            C 1 Reply Last reply
            0
            • U unitecsoft

              Talking about oracle versions , is there a major difference in operation between Oracle 8 and oracle 9 . If I am going to start learning oracle fresh , is it better to start with 8 or 9 . We will either find a way or make one ! Hanipal Dean

              C Offline
              C Offline
              Chris Meech
              wrote on last edited by
              #6

              I don't think it will matter which version you end working with in order to learn Oracle. My recommendation though would be to take a couple of hands-on training courses. The first would either be a beginner or intermediate course in how to use SQL. Then after you have become comfortable with that knowledge and perhaps even been programming, you should step up and take a database administration course. I've always felt that my best understanding of the how/what/why Oracle does, was a result of an administration course. Good Luck to you. :) Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups