Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:07:17+00:00 2026-05-26T00:07:17+00:00

I am trying to use SilverlightPhoneDatabase to use a sqlite db for my Windows

  • 0

I am trying to use SilverlightPhoneDatabase to use a sqlite db for my Windows Phone 7 application.

The dll has a class Database

    public class Database
    {
    .
    .
    .
    public Table<T> Table<T>();
    .
    .
    }

Definition of class Table is as follows:

public class Table<T> : ObservableCollection<T>, ITable

Then in my App.xaml
I have a method

 public static Database MyDB
 {
get
{
// Delay creation of the view model until necessary
if (database == null)
OpenDatabase<MyObj>("MyObj");
return database;
}
}

Now from my xaml.cs file I am able to access the .ToList() method on the Table.
ie If I say

App.MyDB.Table<MyObj>().ToList();

from my main.xaml.cs, I can access the ToList() method (Table class inherited from ObservableCollection..)

But I created a new class in a new cs in the same namespace.. and if I try to access the ToList() method on the Table class, I am getting compiler error that Table<> does not contain definition for ‘ToList’

I am just curious why is it not working? It may be something silly I am missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:07:18+00:00Added an answer on May 26, 2026 at 12:07 am

    ToList is an extension method on IEnumerable<T> : System.Linq.Enumerable.ToList so you need to add an using for the System.Linq namespace to be able to use it.

    The compiler is basically rewriting

    App.MyDB.Table<MyObj>().ToList();
    

    as

    System.Linq.Enumerable.ToList(App.MyDB.Table<MyObj>());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use records with the cursor and later index by table in the
I am trying use filehelpers class builder but I am kinda confused on what
I have a 3rd party DLL that I am trying to use in a
Trying to use the getDependentRowset in a ZF application. I have the following relationship
I am trying use the jQuery table sorter plugin for a table that is
Trying to use WMI to obtain a list of installed programs for Windows XP.
Im trying use a Java annotation in a Groovy class but have trouble to
I'm trying use jquery to remove a class from an element (not knowing ahead
I was trying use a set of filter functions to run the appropriate routine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.