Based on the error message you set a string to the parameter as value and trust that the database does the conversion to bigint for you. This won't happen if the string is invalid on the database side so instead you should explicitly do the conversion at calling side.
First of all define the data type for the parameter using
SqlParameterCollection.Add Method (System.Data.SqlClient), Add(String, SqlDbType) [
^]
Now before setting the parameter you can use
Int64.TryParse Method (System) | Microsoft Docs[
^] to parse the text to proper number. Depending on the situation, you may need to remove the thousand separators or change decimal point.
After that you can set the number as the parameter value and the database doesn't need to do any conversion.