22
So in C# to use a stored procedure I have code like the following (connection code omitted):
string sql = "GetClientDefaults";
SqlCommand cmd = new SqlCommand(sql);
cmd.CommandType = CommandType.StoredProcedure; //<-- DO I NEED THIS??
cmd.Parameters.AddWithValue("@computerName", computerName);
Where sql is the name of a stored procedure. Now, this code seems to work just fine with and without the commented line.
So, do I need this line? Is there some performance (or other) benefit to setting this? Is there a benefit to NOT setting it or setting it to Text?