The problem is that you reused SqlCommand , which CommandType is StoredProcedure , but you want to execute a regular SQL query using CommandType.Text .
"In this case, do I need to create a new instance of the SqlCommand object?"
I would suggest doing this to avoid such confusion. Creating SqlCommand not so expensive that you need to reuse it. In fact, the constructor sets nothing more than properties.
From ILSpy :
// System.Data.SqlClient.SqlCommand // this() does only call _SuppressFinalize public SqlCommand(string cmdText, SqlConnection connection) : this() { this.CommandText = cmdText; this.Connection = connection; }
source share