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. General Programming
  3. C#
  4. C# -Oracle- Access

C# -Oracle- Access

Scheduled Pinned Locked Moved C#
csharpdatabasesql-serveroracletools
5 Posts 4 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.
  • B Offline
    B Offline
    bigphish
    wrote on last edited by
    #1

    hi.. I m new to Oracle and c#.still I am tryiyng to picking up stones here :) currently I am working on Script Task tool in SSIS (Using c#) in which I need to store the resultset from my Oracle stored procedure in to a MS access table.Below is the code:

    public void Main()
    {
    OracleConnection conn = new OracleConnection();
    // TODO: Add your code here
    conn.ConnectionString= "UserId=XXXX;Password=XXXX;Data Source= "XXXXXXX;";

             conn.Open();
                           
            //execute stored procedure here
            DataTable resultDT = new DataTable();
            
            OracleCommand Cmd = new OracleCommand();
            Cmd.Connection = conn;
            Cmd.CommandText = "My\_StoreProc";
            Cmd.CommandType = CommandType.StoredProcedure;
            OracleParameter\[\] paramsArray = new OracleParameter\[2\];
            paramsArray\[0\] = new OracleParameter("fromDate", OracleDbType.Date, ParameterDirection.Input);
            paramsArray\[1\] = new OracleParameter("toDate", OracleDbType.Date, ParameterDirection.Input);
    

    ..and here after I am stucked how to proceed with ..:-( how to use Oracle dataadapter,dataset and store this result set in an Access table?Any help will be appreciated! Thanks in advance! BigFish

    R J 2 Replies Last reply
    0
    • B bigphish

      hi.. I m new to Oracle and c#.still I am tryiyng to picking up stones here :) currently I am working on Script Task tool in SSIS (Using c#) in which I need to store the resultset from my Oracle stored procedure in to a MS access table.Below is the code:

      public void Main()
      {
      OracleConnection conn = new OracleConnection();
      // TODO: Add your code here
      conn.ConnectionString= "UserId=XXXX;Password=XXXX;Data Source= "XXXXXXX;";

               conn.Open();
                             
              //execute stored procedure here
              DataTable resultDT = new DataTable();
              
              OracleCommand Cmd = new OracleCommand();
              Cmd.Connection = conn;
              Cmd.CommandText = "My\_StoreProc";
              Cmd.CommandType = CommandType.StoredProcedure;
              OracleParameter\[\] paramsArray = new OracleParameter\[2\];
              paramsArray\[0\] = new OracleParameter("fromDate", OracleDbType.Date, ParameterDirection.Input);
              paramsArray\[1\] = new OracleParameter("toDate", OracleDbType.Date, ParameterDirection.Input);
      

      ..and here after I am stucked how to proceed with ..:-( how to use Oracle dataadapter,dataset and store this result set in an Access table?Any help will be appreciated! Thanks in advance! BigFish

      R Offline
      R Offline
      RexGrammer
      wrote on last edited by
      #2

      You shouldn't use the .NET oracle data provider, because the libraries are deprecated. A cite:

      Quote:

      The types in System.Data.OracleClient are deprecated. The types are supported in version 4 of the .NET Framework but will be removed in a future release. Microsoft recommends that you use a third-party Oracle provider.

      Source: Oracle and ADO.NET[^]

      B 1 Reply Last reply
      0
      • R RexGrammer

        You shouldn't use the .NET oracle data provider, because the libraries are deprecated. A cite:

        Quote:

        The types in System.Data.OracleClient are deprecated. The types are supported in version 4 of the .NET Framework but will be removed in a future release. Microsoft recommends that you use a third-party Oracle provider.

        Source: Oracle and ADO.NET[^]

        B Offline
        B Offline
        bigphish
        wrote on last edited by
        #3

        Hi there. I am using .NET Oracle.DataAccess.dll.. I m pretty sure that it can be done.Can anyone lead me till the dataset fill? Regards, BF

        M 1 Reply Last reply
        0
        • B bigphish

          Hi there. I am using .NET Oracle.DataAccess.dll.. I m pretty sure that it can be done.Can anyone lead me till the dataset fill? Regards, BF

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          What Rex said is that while it works now it will not work in the future, change your data provider before going any further. I would extract the data into a table/list via the data connection, create another connection to the Access database and write the table/list to the destination table in Access.

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • B bigphish

            hi.. I m new to Oracle and c#.still I am tryiyng to picking up stones here :) currently I am working on Script Task tool in SSIS (Using c#) in which I need to store the resultset from my Oracle stored procedure in to a MS access table.Below is the code:

            public void Main()
            {
            OracleConnection conn = new OracleConnection();
            // TODO: Add your code here
            conn.ConnectionString= "UserId=XXXX;Password=XXXX;Data Source= "XXXXXXX;";

                     conn.Open();
                                   
                    //execute stored procedure here
                    DataTable resultDT = new DataTable();
                    
                    OracleCommand Cmd = new OracleCommand();
                    Cmd.Connection = conn;
                    Cmd.CommandText = "My\_StoreProc";
                    Cmd.CommandType = CommandType.StoredProcedure;
                    OracleParameter\[\] paramsArray = new OracleParameter\[2\];
                    paramsArray\[0\] = new OracleParameter("fromDate", OracleDbType.Date, ParameterDirection.Input);
                    paramsArray\[1\] = new OracleParameter("toDate", OracleDbType.Date, ParameterDirection.Input);
            

            ..and here after I am stucked how to proceed with ..:-( how to use Oracle dataadapter,dataset and store this result set in an Access table?Any help will be appreciated! Thanks in advance! BigFish

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            1. Write code that ONLY gets data from Oracle. If the result set is large then create a streaming idiom. You extract the results into a data structure written in C#. 2. Test it. 3. Write code that ONLY puts data into Access. You use the above data structure. 4. Test that. 5. Put 1 and 3 together.

            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