Input string was not in a correct format

plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help the form was working properly and dunno why that error apears ......suddenly :(

here is the code :

ds=Manager.Select("select max(BOOK_CODE)from BOOK");
double tempbookcode=Convert.ToDouble(ds.Tables[0].Rows[0].ItemArray0].ToString())+1;
this.bCode=tempbookcode.ToString();


pleas this is so urgent

Comments

  • hello,
    1. plz check as below before converting to double
    if(ds.Tables[0].Rows[0].ItemArray[0] != null)
    {
    tempbookcode=Convert.ToDouble(ds.Tables[0].Rows[0].ItemArray[0].ToString())+1;
    }

    2. ds.Tables[0].Rows[0].ItemArray0].
    ^ one [ is missing here

    regds,
    jme

    : plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help the form was working properly and dunno why that error apears ......suddenly :(
    :
    : here is the code :
    :
    : ds=Manager.Select("select max(BOOK_CODE)from BOOK");
    : double tempbookcode=Convert.ToDouble(ds.Tables[0].Rows[0].ItemArray0].ToString())+1;
    : this.bCode=tempbookcode.ToString();
    :
    :
    : pleas this is so urgent
    :



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion