F
Fia
Hi
I'm using the code below. And I get the error that quest is local, which I
understand, but how can I do instead to fill an ArrayList with the objects.
public ArrayList createQuestArr()
{
ArrayList quest = new ArrayList();
foreach (DataRow row in ds.Tables["Frgor"].Rows)
{
ArrayList answ = new ArrayList();
int nr = (int)row.ItemArray[0];
string quest = (string)row.ItemArray[1];
string ra = (string)row.ItemArray[6];
for (int i = 2; i <= 5; i++)
answ.Add(row.ItemArray);
Question q =new Question (nr,quest ,answ, ra );
quest.add(q);
}
}
Please help
Fia
I'm using the code below. And I get the error that quest is local, which I
understand, but how can I do instead to fill an ArrayList with the objects.
public ArrayList createQuestArr()
{
ArrayList quest = new ArrayList();
foreach (DataRow row in ds.Tables["Frgor"].Rows)
{
ArrayList answ = new ArrayList();
int nr = (int)row.ItemArray[0];
string quest = (string)row.ItemArray[1];
string ra = (string)row.ItemArray[6];
for (int i = 2; i <= 5; i++)
answ.Add(row.ItemArray);
Question q =new Question (nr,quest ,answ, ra );
quest.add(q);
}
}
Please help
Fia