Getting value from sqlite with index
Posted: Sat 04 Feb 2017 06:10
I am getting datas from sqlite file like this:
But I think this method is so amateur. I want to iterate datas in one row with iteration number (index). I think it would be like this:
But I don't know, what to write instead of question marks?
Kind regards,
Mehmet.
Code: Select all
var persons = _conn.persons;
foreach (var person in persons)
{
var r = radGridView1.Rows.AddNew();
r.Cells[0].Value = person.Id;
r.Cells[1].Value = person.Name;
r.Cells[2].Value = person.Surname;
r.Cells[3].Value = person.Age;
}
Code: Select all
var persons = _conn.persons;
var i = 0;
foreach (var person in persons)
{
var r = radGridView1.Rows.AddNew();
r.Cells[i].Value = ?????;
i++;
}
Kind regards,
Mehmet.