Cannot assign Devart.Data.Linq.Table<T> to ListBox.ItemSourc

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
bbjosh
Posts: 6
Joined: Fri 07 Nov 2008 19:38

Cannot assign Devart.Data.Linq.Table<T> to ListBox.ItemSourc

Post by bbjosh » Fri 07 Nov 2008 19:58

I cannot assign Devart.Data.Linq.Table to ListBox.ItemSource (IEnumerable). Doing so results in a "Not Implemented" exception. Im using the OraDirect.NET driver and Oracle 11.


The same code works using the default LINQ driver for SQL Server and a corrisponding SQL server database.

Code: Select all

         DataContext DB = new DataContext(myConnectionString);


            // This code fails using Devart LINQ driver, but works correctly 
            //with SQL server driver.  The USER.ToString() function has been
            //overridden to display 'Name'

            //lbCustomers.ItemsSource = DB.USERs;

           
           //this code works for both drivers
           foreach (var User in DB.USERs)
           {
               lbCustomers.Items.Add(User.Name);
           }


mr_fsx
Posts: 6
Joined: Wed 24 Sep 2008 12:43

Post by mr_fsx » Tue 11 Nov 2008 09:59

Maybe you need to concretise it before you can use it as datasource?

Try this:
lbCustomers.ItemsSource = DB.USERs.ToList();

If that doesn't work try selecting the name:
lbCustomers.ItemsSource = DB.USERs.Select(user => user.Name).ToList();

Post Reply