I read similar questions and responses on this issue, and tried a number of different ways to do this, but was not successful. The records show up in the datagrid in random order, not ordered by last name. Thank you in advance.

```cpp
MyEntities theEntities = new MyEntities();

IEnumerable<NameTable> nameitems = (from myrow in theEntities.NameTable.AsEnumerable()
orderby myrow.NameID
select new NameTable
    {NameID = myrow.NameID,
    FirstName = myrow.FirstName,
    LastName = myrow.LastName});

ObservableCollection<NameTable> nameitemsOC = new ObservableCollection<NameTable>(nameitems);

return nameitemsOC;

```