Sunday, February 19, 2012

How can i find the exact error line ?

Hi all,

i have an insert function using stored procedure with parameters. At some point while assigning parameters i make a casting problem but all i get is:

String was not recognized as a valid Boolean.

how can i find the exact line causing the error?

thank you

-shane

can you post the code? Perhaps you are passing some incompatible value for a boolean type parameter?|||It's listed in the stack trace that follows that message you pasted here. If you stopped the program in VS 2005, tell it to continue executing, and you'll see it on the HTML page.|||I m using vs 2003 and in the stack tree there is no explanation about it. i found the problem , i was trying to compare a posted radiobutton list item value (which is 0 or 1) with 0 and 1 wihtout knowing radiobutton values were sent as string. i got teh error message because i was going like :
if request("rblcontrol') then
do this...
end if

The problem is; i dont get the line that was causing the problem. And this is what i was looking for. You find the prblem this way or that way, maybe after several hours, but is there a way to get the exact line number that is causing hte problem. Stack tree doesnt give me this, if it would i woulnt ask this question. I tried debugging but i m not getting the error while debugging either. its just happening at the end without giving me any clue of whats causing the problem.

Any ideas/
thank you
-shane|||Usually it will tell you in vs or in a webpage the error with the exact page as long as the page was run on the local computer. Did you end up casting the value to boolean?|||

Once again, my problem isnt with the page. Of course i m getting the error in the page it occurs. The problem is the line that causes the problem.

I am gettng ar error in abc.aspx but the only thing i get is generic error message. For some cases i get the line number, usually for the casting problems i never get the line number. Its taking for ever to find which line causes the problem because sometimes everthing looks so right.

-shane

|||You're not being clear. Which line number? In your .aspxpage, in your code-behind page, or in your stored procedure?

Could you possibly show the part of the code casuing trouble and the exact copy-and-paste of the error screen?

No comments:

Post a Comment