Yes, C# doesn't allow you to use unitialized variables. Where are you setting the value of CatId? Are you trying to manipulate it before you set it? If you're setting the value within a conditional statement, it will throw that error because that condition might not always be met, so you can either initialize it, or have additional steps to set the value.
Yeah, it's in a conditional statement, therefore if that statement isn't met, the value of CatId will never be assigned. You can either initialize it when you declare it, or have an else clause which assigns it some value when the condition isn't met.