I am getting nullPointerException at this point and this is my code:
int reservationID = Convert.ToInt32(dgvReservation.Rows[a].Cells[0].Value.ToString());
public void GetResrervationTables()
{
ManagerTableReservation mgrTableReservation = new ManagerTableReservation();
for (int a = 0; a < dgvMenuItems.Rows.Count; a++)
{
int reservationID = Convert.ToInt32(dgvReservation.Rows[a].Cells[0].Value.ToString());
List<int> listOfReservationTables = mgrTableReservation.GetReservationTablesByReservationID(reservationID);
string tables = "";
foreach (int t in listOfReservationTables)
{
int count = listOfReservationTables.Count;
tables = tables + "," + t.ToString();
count--;
}
dgvReservation.Rows[a].Cells[7].Value = tables;
}