locked
how to solve for namespace name 'OracleBulkCopy' could not be found issue ? RRS feed

  • Question

  • User1248258412 posted
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.IO;
    using Microsoft.VisualBasic;
    using System.Collections;
    using System.Data;
    using System.Diagnostics;
    using System.Configuration;
    using System.Text;
    using System.Data.OleDb;
    using System.Data.OracleClient;
    
    //using Oracle.DataAccess;     
    //using Oracle.DataAccess.Client;
    
    
    					{
                                                OracleConnection objConnection = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
                                                    objConnection.Open();
                                                    using (OracleTransaction OracleTransaction = objConnection.BeginTransaction())
                                                    {
                                                        using (OracleBulkCopy OracleBulkCopy = new OracleBulkCopy(objConnection, OracleBulkCopyOptions.Default, OracleTransaction))
                                                        {
                                                            OracleBulkCopy.DestinationTableName = "OP_TTP_TBL";
    
                                                            OracleBulkCopy.ColumnMappings.Add("CONTACT_NAME", "CONTACT_NAME");
                                                            OracleBulkCopy.ColumnMappings.Add("APP_NAME", "APP_NAME");
    
                                                                OracleBulkCopy.WriteToServer(dt);
                                                                OracleTransaction.Commit();
                                                            
                                                        } 
                                                    }
                                                    objConnection.Close();
                                            } 

    My code as above with the reference I using in my page, but I always hit error 'The type or namespace name 'OracleBulkCopy' could not be found (are you missing a using directive or an assembly reference?)

    Anyone know how to resolve of this? try to search from Google and tested many way also same..

    If I added //using Oracle.DataAccess;    
    //using Oracle.DataAccess.Client;

    it will showing "Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format."

    Monday, October 24, 2016 1:54 AM

Answers