Failed to fetch rows returns IBM.Data.DB2.Core.DB2Exception

0

My query is working fine when I am using query browser and the fetch time is around 20-30 secs with 1000 rows.

However If I am going to bind my query on my code it throws me an exception without providing specific error details even I already removed the try-catch block on the line. Here the sample details and snapshot of the error:

IBM.Data.DB2.Core.DB2Exception: 'External component has thrown an exception.' enter image description here

Here is my sample code:

myConnection.Open();

string query = "SELECT colA, colB FROM TableA";

DB2Command selectCommand = new DB2Command(query, myConnection);
List<x> l = new List<x>();


DB2DataReader reader = selectCommand.ExecuteReader();
while (reader.Read())
{
    x res = new x();

    res.myVarA = reader.GetString(0).Trim();
    res.myVarB = reader.GetString(1).Trim();    

    l.Add(res);
}
myConnection.Close();
return l;

Here is the full error details on exception:

+       $exception  {IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [57014] [IBM][DB2/AIX64] SQL0952N  Processing was cancelled due to an interrupt.
   at IBM.Data.DB2.Core.DB2DataReader.Read()
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()}  IBM.Data.DB2.Core.DB2Exception
c#
db2
asked on Stack Overflow Apr 15, 2020 by Rock n' Roll • edited Apr 15, 2020 by Rock n' Roll

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0