C# connecting to Oracle not returning rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbewers1
    New Member
    • Feb 2009
    • 68

    C# connecting to Oracle not returning rows

    Hi there,

    I'm having a strange problem whereby I can execute a select query in Oracle SQL Developer that rerturns some rows but, when this same query is placed into C#, I get no results.

    I've debugged the code and the date that I am passing in in the site is indeed being passed through to the query, but no rows are being returned.

    Please can you help me understand what code in my statement is causing the problem as similar queries in my C# class are returning rows.

    Thanks
    Matt

    Oracle Statement:

    Code:
    SELECT corporateactionnumber, sedolnumber, isincode, stockname, corporateactiontype, receiveddate, admincode, signedoff 
    FROM tblcorporateactions 
    WHERE receiveddate = to_date('23-Jan-08', 'DD-MON-YY')
    C# Class method with statement:

    Code:
    string queryString = string.Format(@"SELECT corporateactionnumber, sedolnumber, isincode, 
    stockname, corporateactiontype, receiveddate, admincode, signedoff 
    FROM tblcorporateactions 
    WHERE receiveddate = to_date({0}, 'DD-MON-YY')", date);
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Use SQLCommand and pass the date as a Parameter.

    Comment

    Working...