Click here to Skip to main content
16,016,613 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
hi i executed a program wer im reading excel sheet from database. it was successfully done. but now i want to check whether the excel sheet contains header "productname", if it doesnot contain productname then we will get error. . .
so at that time i want to display error msg. and end that program thier only..
no further execution, want to skip remaining part and end the program
can u send me some code using break or stop or end...

throw exception is not working
thanks in adv.. plaese send code
Posted
Updated 19-Mar-10 19:37pm
v4

Have a loo at the Throw command e.g.
Throw New Exception("Some error occured")


You will have to check the exact syntax as I don't have VB.Net installed.
 
Share this answer
 
i got it by using on error


On Error GoTo nextstep


nextstep:
MsgBox(" wrong informat")
Response.Write(" ***** UPLOAD.1 CONTAINS WRONG EXCEL FORMAT ***** ")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900