Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
its representing error
not all code path returns a value
Posted

1.This error is generated, by the fact that some of your method branch/path do not have return intExpression; on it, for example you missed to add return expression into an else branch or something.

2.In order to can give you more help you have to publish your method in your original question above!
 
Share this answer
 
It's declared as a method returning an integer value - but the compiler can see a path through the method where no value is returned, and no exception is thrown.
This would mean a problem at run time, so the compilation fails.
The normal reason for this to forget the "return x;" at the very end, or to miss out the value with a return statement completely; or to have intended the method to not return a value at all. In the later case change the definition to:
C#
public static void insert_value(...


Have a good look at the code - it should be fairly obvious.

And please, try to follow C# naming conventions, which do not include underscores: the method should be called InsertValue, not insert_value
 
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