First thing we would need to know is how you are sending the value from the C# application.
If it is being sent as a string, you need to read all the characters, store them in a char array, NULL terminate the array, and use atoi() to convert the array to an integer.
SERIAL DATA is sent as ASCII characters, not as VALUES.
You could send ASCII "1000", but that is in reality most likely sent as the following "decimal" ASCII values: "49,48,48,48,13,10" with 13 and 10 being there or not as line endings. So you need to create an "interpreter" that recreates the ASCII data back into a value.
The question comes up a lot so a search will find some solutions.