Page 1 of 1

Getting value from sqlite with index

Posted: Sat 04 Feb 2017 06:10
by habipoguz
I am getting datas from sqlite file like this:

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;
}
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:

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++;
}
But I don't know, what to write instead of question marks?

Kind regards,
Mehmet.

Re: Getting value from sqlite with index

Posted: Mon 06 Feb 2017 16:09
by Shalex
The indexers in the generated entities of LinqConnect model are not implemented. Please assign values like you do.

Re: Getting value from sqlite with index

Posted: Mon 06 Feb 2017 21:23
by habipoguz
Thank you very much,
Kind regards.