Set CommandType text to text
command.CommandType = CommandType.Text
More details from Damien_The_Unbeliever , regarding whether, by default, .NET by default SqlCommandTypes prints text.
If you separate the getter for CommandType into SqlCommand, you will find that there is a strange special shell in which, if the value is currently 0, it lies and says that Text / 1 is used instead (similarly, from the / design component, the default value is indicated as 1). But the actual internal value remains equal to 0.
source share