PLZ help me.its so simple RRS feed

  • Question

  • dbCommand.CommandText = "Select FORMAT(SUM(totalDocuments),0)from tbBatch where batchName Like '*"+batchstartname+"*'";
            //above is my command       
                    dbReader = dbCommand.ExecuteReader();
    //then execute this reader now i want value of this sum i try with every method like
    int a=dbReader(0);
    string b=dbReader.getstring(0);
    but its return a null vale plz tell me how can i get value of sum using in my commandtext
    Tuesday, July 24, 2007 10:42 AM

All replies

  • Hi,


    int a=dbReader(0);
      string b=dbReader.getstring(0);

    Before these lines, include the following:




    I hope this could help you.




    Tuesday, July 24, 2007 11:07 AM
  • Assume that it is in Access.
    Same query working for me.Please run the command text in query bulder.
    If same problem check data

    Tuesday, July 24, 2007 11:18 AM
  • i find da solution .we just use like---% insted of like-----* .its true that access uses * but when ur r coding in .net it is using odbc driver so it automatically convert % to *.
    Wednesday, July 25, 2007 5:39 AM