CommandType

noun

say it: “kuh-MAND type” /kəˈmænd taɪp/

An ADO.NET command setting that says whether its text is SQL or the name of a stored procedure.

What is CommandType in C#?

CommandType — A setting on an ADO.NET command that says what its text is: SQL (the default, Text) or the name of a stored procedure (StoredProcedure). With StoredProcedure, the parameters you add become the procedure's parameters.

using SqlCommand command = new("CustOrderHist", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@CustomerID", "ALFKI");

In a sentence

  • “I set CommandType to StoredProcedure and passed just the procedure's name.”

Level: Journeyman · More C# terms at this level

Updated