locked
Enumeration did not produce results RRS feed

  • Question

  • User662762443 posted

    Eu não sou capaz de ler os valores retornados do banco de dados Oracle.
    Este é o meu método GetCodProcInter:

    Thursday, June 14, 2018 6:56 PM

Answers

  • User303363814 posted

    This question seems to have nothing to do with either ASP.NET or C# - you may be better off finding some Oracle programming forum ...

    However, … your SQL query uses the count expression and so does not produce a recordset as a result.    From the dusty corners of my memory I seem to recall that you need to create a command and do a cmd.ExecuteScalar() to get the result in this sort of situation.  But it is a very, very long time since I have looked at ADO.Net code.

    BTW - this sort of thing is much easier with Entity Framework or even LinqToSql.  You might want to investigate updating your database access method.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 15, 2018 3:26 AM

All replies

  • User303363814 posted

    This question seems to have nothing to do with either ASP.NET or C# - you may be better off finding some Oracle programming forum ...

    However, … your SQL query uses the count expression and so does not produce a recordset as a result.    From the dusty corners of my memory I seem to recall that you need to create a command and do a cmd.ExecuteScalar() to get the result in this sort of situation.  But it is a very, very long time since I have looked at ADO.Net code.

    BTW - this sort of thing is much easier with Entity Framework or even LinqToSql.  You might want to investigate updating your database access method.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 15, 2018 3:26 AM
  • User662762443 posted

    Hi PaulTheSmith, I followed your guidelines and it worked, your tip also helped a lot. A big hug!

    Wednesday, July 4, 2018 12:47 AM