Facebook
From Walloping Kangaroo, 6 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 154
  1. public static void HowManyRecords(SqlConnection sqlConnection, DataGridView dataGridView,string limitOfRecords)
  2.         {
  3.             SqlDataAdapter sqlDataAdapter = new SqlDataAdapter($@"
  4.             SELECT TOP '{limitOfRecords}' Patients.Name AS ImiÄ™, Patients.Surname AS Nazwisko, Age AS Wiek,
  5.                 Rooms.RoomNumber AS 'Numer pokoju', Doctors.Name AS 'ImiÄ™ lekarza',
  6.                 Doctors.Surname AS 'Nazwisko lekarza'
  7.             FROM Patients JOIN Rooms ON RoomID = Rooms.ID
  8.                           JOIN Doctors ON DoctorID = Doctors.ID", sqlConnection);
  9.             FillDataGridView(sqlDataAdapter, dataGridView);
  10.         }