Help me with oracle sql not picking values?

Last post 11-03-2009 2:10 AM by Mobzam. 2 replies.

Sort Posts:

  • Help me with oracle sql not picking values?

    11-02-2009, 10:40 AM
    • Member
      55 point Member
    • Mobzam
    • Member since 05-22-2008, 4:00 AM
    • Posts 488

    I am developing web application using Csharp and orcale as database.I have 2 problems.

    1 when I run the sql  below it is not picking the value even when they is a value. Where I am going wrong?
    2 The value is not been used outside the  
       while (OraclerRD.Read())
                 {
                   VaAmountPaid = OraclerRD[0].ToString();
                 }
    How can I ensure that it is being used outside the while. Please help.

    sql = "SELECT AmountToBePaid FROM SalesPayment  WHERE salesday ='" + VouncherNumber + "' AND KEYYEAR ='" + Year.ToString() + "' AND  KEYStation='" + Station.ToString() + "'";
                 OraclerRD = CheckDetails.myIdsReader(sql, ccon);
                 while (OraclerRD.Read())
                 {
                   VaAmountPaid = OraclerRD[0].ToString();
                 }


  • Re: Help me with oracle sql not picking values?

    11-02-2009, 11:00 AM
    • Member
      426 point Member
    • garuka
    • Member since 07-16-2009, 9:46 AM
    • UK
    • Posts 149

    1. I can't see anything wrong with your query. Try running the query in debug mode and check the values you are getting

    as parameters.

    2. declare the VaAmountPaid globally...

    Since you are several lot of values here using a array or list would be great. So simply you can do whatever you want to do

    inside the loop itself.


    Thanks
    /Garuka
    _____________________________________
    Please Mark as answer if it helps you
  • Re: Help me with oracle sql not picking values?

    11-03-2009, 2:10 AM
    • Member
      55 point Member
    • Mobzam
    • Member since 05-22-2008, 4:00 AM
    • Posts 488

    Hello, Have tried but it is not working

Page 1 of 1 (3 items)