input string was not in acorrect format
Hi Everyone,
I was wondering if someone could help me. I am trying to get the value of a parameter from a stored procedure. I keep getting the error "Input string was not in a correct format.". It looks like it is in the correct format to me. Any suggestions?
Here's the code that gets the error.....
customer.id=convert.toint32(rd[0].tostring)
where rd is a sql dataReader
read from the stored procedure
frostyraverPosted May 16, 2009, 10:42 PM
// If there is selected items do this
if (lisbox.items.selected != null)
{
// Code for your program here if the listbox is selected
}
// If there are no items selected then display this
else
{
// Error display code here
}
You could maybe set up an error checker that way?
sara khatibPosted Apr 21, 2009, 11:42 AM
frostyraverPosted Apr 21, 2009, 11:20 AM
customer.id <= is this customer id an int?
=convert.toint32(rd[0].tostring) <= your trying to convert an array of customer ids to an int?
I'm not sure elaborate on this subject. If your seeing this message it's because you have a string value somewhere, you might need more converts or something.