In your sql query the input string type is NVARCHAR. This when encoding uses UTF-16.
In C# you used UTF8 encoding.
The byte representation differs in these 2 cases and hence you see diff SHA-256 hashes.
Both are valid. It depends on the encoding you prefer.
If you prefer to use UTF-8 in sql then use VARCHAR for input type.