Input string was not in a correct format is the error i get.

Please let me know what i am doing wrong. Thanks/Saru
I have a method in a class to get products. At the end i am trying to display on the form . here is the pc of code that i am trying to use to display.

///
dim dsProducts as Dataset

Private Sub DisplayProductData()
Dim drprod As
DataRow
drprod = dsProducts.Tables("Products").Rows.Find(ddlprod.SelectedItem.Value)
lbllongdescrip.Text = drprod("LongDescription")
lblprice.Text = FormatCurrency(drprod("UnitPrice"))
imgpic.ImageUrl = "Images\" & drprod("ImageFile")
End Sub

///

The error is:

Server Error in '/HalloweenDB' Application.

Answer this question

Input string was not in a correct format is the error i get.

  • Kardia

    Could you post the value of ddlprod.SelectedItem.Value

    Receiving that error message is usually a sign that your SQL is invalid, you probably need to double check to make sure you are sending a valid string to the Find method.


  • AhmedQurashi

    If possible, can you please post the stack also.



  • Input string was not in a correct format is the error i get.