It's a odd question ... Please help me RRS feed

  • Question

  • Hi Expert,

    I use the code to fetch the oracle sample data as below:

    using (OracleConnection _connection = new OracleConnection(_oradbConnectionString))
                    OracleCommand _cmd = new OracleCommand();
                    _cmd.Connection = _connection;
                    _cmd.CommandText = _oradbSelectStatement +
                        " where OUT_JOB between TO_DATE('" + _beginDate + "', 'MM/DD/YYYY') and TO_DATE('" + _endDate + "', 'MM/DD/YYYY')";
                    _cmd.CommandType = System.Data.CommandType.Text;

                    using (OracleDataReader _reader = _cmd.ExecuteReader())
                        if (_reader.HasRows)
                            while (_reader.Read())
                                ListItemCollection _sPListItemCollection = GetItemsCol(args[0], _reader.GetString(0).ToString());

    But I perform the code again and again every time I got the same value of the date ... even I change the value from oracle ... 

    I don't know why??

    VS .NET Instant Watch

    Oracle View

    Hi there, if you found my comment very helpful then please | Propose as answer | . Thanks and Regards.

    • Edited by Will .H Saturday, January 6, 2018 9:10 AM
    • Moved by Fei Hu Monday, January 8, 2018 8:46 AM Oracle related
    Saturday, January 6, 2018 9:08 AM

All replies

  • Perhaps there is an issue in the WHERE condition, you should never use string concatenation but instead use parameters. See the second code block in this code sample.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, January 6, 2018 10:26 AM
  • Hello will,

    Your description is related third party products, I am afraid that the issue is out of support of C# General Question forum which mainly discusses C# programming language, IDE, libraries, samples and tools.

    I suggest that you can consult your issue directly on Oracle forum for better solution and support.

    If I have misunderstood anything, please feel free to let me know.

    Best regards,

    Neil Hu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 8, 2018 8:45 AM