Getting value from sqlite with index

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
habipoguz
Posts: 9
Joined: Wed 20 Jan 2016 14:16

Getting value from sqlite with index

Post by habipoguz » Sat 04 Feb 2017 06:10

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Getting value from sqlite with index

Post by Shalex » Mon 06 Feb 2017 16:09

The indexers in the generated entities of LinqConnect model are not implemented. Please assign values like you do.

habipoguz
Posts: 9
Joined: Wed 20 Jan 2016 14:16

Re: Getting value from sqlite with index

Post by habipoguz » Mon 06 Feb 2017 21:23

Thank you very much,
Kind regards.

Post Reply