The properties of an object are not necessarily in the same order as the columns in the database.
You can do a reflection to select a property by index, but that doesn't make sense. Instead, use column names.
Based on your comment that columns have a name ending with a number, here is what you can do.
int columnIndex = 3; var property = (from p in db.myTable.GetType().GetProperties() where p.Name.EndsWith(columnIndex.ToString()) select p).First(); var record = db.myTable.single(a=>a.ID==1); var x = property.GetValue(record, null)
source share