2 ms·
One could imagine something like public static void AddParameterValue(this SqlCommand cmd, string paramName, object value) { if (cmd.CommandTex
by ygra 13y ago
One could imagine something like
public static void AddParameterValue(this SqlCommand cmd, string paramName, object value)
{
if (cmd.CommandText.Contains("@" + paramName))
cmd.Parameters.AddWithValue(paramName, value);
}
to help set parameters only if they are referenced in the SQL statement.