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. Web Development
  3. ASP.NET
  4. Transfer excel data to oracle

Transfer excel data to oracle

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netoracletoolsquestion
6 Posts 3 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.
  • A Offline
    A Offline
    amittinku
    wrote on last edited by
    #1

    Hi, There is one utility called SQLBULKCOPY but that is for sqlserver. In asp.net 2.0, there is no as such utility for oracle. My need is to transfer excel data to oracle? Provide any solution.

    R R 2 Replies Last reply
    0
    • A amittinku

      Hi, There is one utility called SQLBULKCOPY but that is for sqlserver. In asp.net 2.0, there is no as such utility for oracle. My need is to transfer excel data to oracle? Provide any solution.

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

      OLEDB

      A 1 Reply Last reply
      0
      • R Robert_Pan

        OLEDB

        A Offline
        A Offline
        amittinku
        wrote on last edited by
        #3

        I have opned an oledb connection to connect to oracle. I am working in offline mode. I fill up the dataset with excel data. Works fine. Now I open oracle connection with oledb only. Created oracle adpater also using oledbadapter. Created the dataset. it contains no rows as table in oracle is empty. Check the code below: string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0"; OleDbConnection oledbConn = new OleDbConnection(connString); OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn); OleDbDataAdapter oleda = new OleDbDataAdapter(); oleda.SelectCommand = cmd; DataSet ds = new DataSet(); oleda.Fill(ds, "Sheet1"); OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123"); OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1); OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1); DataSet ds1 = new DataSet(); oledb.Fill(ds1, "excel_ora"); ds1 = ds.Copy(); OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb); oledb.Update(ds1,"excel_ora"); //the above line thorws error as it does not find table "excel_ora" Response.Write("hi");

        A 1 Reply Last reply
        0
        • A amittinku

          I have opned an oledb connection to connect to oracle. I am working in offline mode. I fill up the dataset with excel data. Works fine. Now I open oracle connection with oledb only. Created oracle adpater also using oledbadapter. Created the dataset. it contains no rows as table in oracle is empty. Check the code below: string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0"; OleDbConnection oledbConn = new OleDbConnection(connString); OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn); OleDbDataAdapter oleda = new OleDbDataAdapter(); oleda.SelectCommand = cmd; DataSet ds = new DataSet(); oleda.Fill(ds, "Sheet1"); OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123"); OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1); OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1); DataSet ds1 = new DataSet(); oledb.Fill(ds1, "excel_ora"); ds1 = ds.Copy(); OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb); oledb.Update(ds1,"excel_ora"); //the above line thorws error as it does not find table "excel_ora" Response.Write("hi");

          A Offline
          A Offline
          amittinku
          wrote on last edited by
          #4

          //Code related to excel string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0"; OleDbConnection oledbConn = new OleDbConnection(connString); OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn); OleDbDataAdapter oleda = new OleDbDataAdapter(); oleda.SelectCommand = cmd; DataSet ds = new DataSet(); oleda.Fill(ds, "excel_ora"); //Code related to Oracle OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123"); OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1); OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1); DataSet ds1 = new DataSet(); oledb.Fill(ds1, "excel_ora"); //Transfer excel dataset to oracle ds1 = ds.Copy(); OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb); oledb.Update(ds1,"excel_ora"); Response.Write("hi"); ----------------------------------------------- Written aboce code. everything fine but data does not transfer to oracle. WHy?

          1 Reply Last reply
          0
          • A amittinku

            Hi, There is one utility called SQLBULKCOPY but that is for sqlserver. In asp.net 2.0, there is no as such utility for oracle. My need is to transfer excel data to oracle? Provide any solution.

            R Offline
            R Offline
            r a m e s h
            wrote on last edited by
            #5

            Use Oracle Data Provider for .NET[^] to connect with Oracle from .NET. Also refer this link: http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyClass.htm[^]

            A 1 Reply Last reply
            0
            • R r a m e s h

              Use Oracle Data Provider for .NET[^] to connect with Oracle from .NET. Also refer this link: http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyClass.htm[^]

              A Offline
              A Offline
              amittinku
              wrote on last edited by
              #6

              I think asp.net 2.0 does not support this. I tried but not working.

              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