Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
there is no row at position 0
How to Reslove Code---


<pre lang="C#">if (Session[&quot;remark&quot;].ToString() == &quot;0&quot;)
{
Session[&quot;remark&quot;] = &quot;1&quot;;
try {
SendleaveDetailS();
}
catch(Exception Ex)
{

}
}</pre>

What I have tried:

i want to resolve exception i have mention code so please help me
Posted
Comments
Jochen Arndt 15-Feb-16 5:42am    
Which function call throws the exception?

To avoid it, check the condition before calling the function. Alternatively handle it inside the catch statement.

1 solution

You cannot 'resolve' the exception: you catch it and handle, in the catch block, the error.
If there is 'no row at position 0' then you probably have a failed query. Depending on your scenario you could inform the user of the failure, or terminate the application or attack the pirates or whatever...
 
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