I'm coding in c# on webpages/razor with MS SQL database
I have a table with the following columns
- Sat1
- Sat2
- Sat3
- Sat4
- ...
- Sat25
I want to loop through each of these, and assign the value to satAvail
I have the following
for (var i = 1; i < 26; i++)
{
satWeek = "Sat" + i;
satAvail = item.satWeek;
}
I want the equivalent of satAvail = item.Sat1;
I've tried a few different lines but having no joy