locked
input string not in the correct format RRS feed

  • Question

  • Hai,

    can anyone help in correcting the mistake.? the error im getting is input string is not in the correct format.

     

     

    SQLSelectQuery pick = new SQLSelectQuery();
                    pick.ExecuteSelectQuery("mir_sptShipping_Sub_New 'INTDAT','01','','','0'");
                    int count = pick.data.Rows.Count;
                    for (int i = 0; i < pick.data.Rows.Count; i++)
                    {
                         int tot = + int.Parse(pick.data.Rows[i]["ORDTOTAL"].ToString());

                    }

    Friday, April 23, 2010 2:26 PM

Answers

  • Is the error occurring when you call that function?

    If so, can you provide the code for that function so we can see what it is expecting?

    If you are just using the parameter to pass to something like ExecuteDataTable, then that is *not* a valid SQL string.

    Is should look something like this:

    "SELECT CustomerId, LastName, " + 
                 "FirstName FROM Customer " +   
                 "WHERE CustomerId=@CustomerId"

    Hope this helps.


    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    • Marked as answer by eryang Friday, April 30, 2010 10:33 AM
    Friday, April 23, 2010 2:59 PM

All replies

  • I don't recognize "SQLSelectQuery" as a .NET class. Is this something in .NET? Or a third party product?

    In most cases, a select statement has a "Select" keyword in it, but since I am not familiar with the library, I don't know what "ExecuteSelectQuery" is expecting as an input parameter.

    If ExecuteSelectQuery is one of your own routines, could you post the code for it?

     


    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    Friday, April 23, 2010 2:40 PM
  • SQLSelectQuery is an object of my own class. where the select query runs.
    Friday, April 23, 2010 2:42 PM
  • Is the error occurring when you call that function?

    If so, can you provide the code for that function so we can see what it is expecting?

    If you are just using the parameter to pass to something like ExecuteDataTable, then that is *not* a valid SQL string.

    Is should look something like this:

    "SELECT CustomerId, LastName, " + 
                 "FirstName FROM Customer " +   
                 "WHERE CustomerId=@CustomerId"

    Hope this helps.


    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    • Marked as answer by eryang Friday, April 30, 2010 10:33 AM
    Friday, April 23, 2010 2:59 PM