Page 1 of 1

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

Posted: Fri 07 Nov 2008 19:58
by bbjosh
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);
           }


Posted: Tue 11 Nov 2008 09:59
by mr_fsx
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();