Oracle server error- “Named Pipes Provider, error:

2020-07-28 11:39发布

I tried to load entire Excel file in Oracle Db. That excel file first row would be header of oracle db. The table name given as "Santhosh". I am getting error complied when execute bulkInsert.WriteToServer(dr); this line.

            OleDbConnection connection = new OleDbConnection();
            connection.ConnectionString = ConnectionString(newlocation_filename, "Yes");
            OleDbCommand command = new OleDbCommand("select * from [Sheet1$]", connection);
            connection.Open();
            DbDataReader dr = command.ExecuteReader();
            string oracleConnectionString = "Data Source=xxxxxxx.x.xxxx.com;Initial Catalog=xxxx;User ID=xxxx;Password=xxxxx";
            SqlBulkCopy bulkInsert = new SqlBulkCopy(oracleConnectionString );
            bulkInsert.DestinationTableName = "Santhosh";
            bulkInsert.WriteToServer(dr);

The error i have received is A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) and one more doubt is i am using oracle server but why i am getting the error related to SQL server

0条回答
登录 后发表回答