Most of the times the reason behind this error is passing object instead of specific value of that object.
For example, based on the line of error, you might have prepared a SQL query with parameters. While assigning values to those parameters, if you assign the textbox directly (instead of textbox Text), above error will occur.
So, try:
cmd.Parameters.AddWithValue("@someParam", TextBox1.Text)
Check and try!