Search code examples
asp.netvb.netvisual-studio-2015oracle12c

compatiblity between Asp.net 4.5.2 with Oracle12c


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 .

  • Oracle 11G - 5 seconds
  • Oracle 12C - 463 seconds

But if I run the same query directly in both servers (without .NET):

  • Oracle 11g - 15 seconds
  • Oracle 12C - 4 seconds

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"/>

Solution

  • 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