我有以下代码:
using (SqlCommand command = new SqlCommand())
{
command.CommandType = System.Data.CommandType.StoredProcedure;
command.Connection = new SqlConnection();
command.CommandText = "";
command.Parameters.Add(new SqlParameter("@ExperienceLevel", 3).Direction = System.Data.ParameterDirection.Input);
SqlDataReader dataReader = command.ExecuteReader();
}
在声明我当前声明它的 SqlConnection 时是否有任何功能影响,而不是像这样?:
using (SqlCommand command = new SqlCommand())
using (SqlConnection connection = new SqlConnection())
谢谢