private static string[] GetMIParameters(int id) { IConfiguration _configuration = new ConfigurationData(); using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString())) { var result = new List <string>(); connection.Open(); string sql = @"SELECT Title FROM MediaInfoParameter where MediaInfoTypeId = @id"; SqlCommand command = new SqlCommand(sql, connection); command.Parameters.Clear(); command.Parameters.AddWithValue("id", id); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { result.Add(reader.GetString(0)); } return(result.ToArray()); } }