I am trying to run a select query in Oracle 12c using ASP.net vb code (Framework - 4.5.2).
It is taking a long time to bind data in datatable.
da.Fill(ds) - fill dataset using dataadapter
Initially it was oracle 11g, The same code works fine in that but not in 12C , the performance is very slow.
Below is the time taken when we connect the same code to different server to fetch same 10 records .
But if I run the same query directly in both servers (without .NET):
This is for fetching the same 10 records, in both cases.
Below is the .NET code used:
VB.NET code:
oraConn.Open()
da.SelectCommand = myComm
da.Fill(dt)
oraConn.Close()
web.config:
<add name="OracleCon" connectionString="SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))(CONNECT_DATA=(SERVICE_NAME=)));uid=;pwd=;" providerName="Oracle.DataAccess.Client"/>
Instead of using system.data.oracleclient
, using Oracle.ManagedDataAccess.Client
fixed the performance issue.
Imports Oracle.ManagedDataAccess.Client
in code. In references add
Oracle.ManagedDataAccess