public ShowTestResults() { InitializeComponent(); ITestResultRepository testResultRepository = new TestResultRepository(ConfigurationManager.ConnectionStrings["ConnectionPatientResults"].ConnectionString); var parameters = new[] { new SqlParameter(StoredProcedureParameters.spName, PatientRepository.PatientName), new SqlParameter(StoredProcedureParameters.spLastName, PatientRepository.PatientLastName) }; var result = testResultRepository.ExecuteReader(StoredProcedureNames.SpGetPatientResultByName, TestResultParser.Instance.MakeResult, parameters); DataTable dataTable = result.ConvertToDataTable(); dataGridTestResults.ItemsSource = dataTable.DefaultView; }