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 8071509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:42:39+00:00 2026-06-05T13:42:39+00:00

Windows Phone 7.1 supports SQL Server CE and LINQ to SQL, as well as

  • 0

Windows Phone 7.1 supports SQL Server CE and LINQ to SQL, as well as upgrading the database via DatabaseSchemaUpdater.

On other platforms I would read the database schema tables (e.g. sys.objects) to view the current schema and work out what tables/columns need to be upgraded.

Given that no direct SQL access is allowed on Windows Phone, how can retrieve the current database schema?

  • 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-06-05T13:42:41+00:00Added an answer on June 5, 2026 at 1:42 pm

    SQL Server CE still includes the INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS tables, but it is a little tricky to access them as no direct SQL access is allowed.

    However, you can create a DataContext which maps to these tables:

    public class SchemaContext : DataContext
    {
        public SchemaContext()
            : base("Data Source=isostore:/Database.sdf")
        {
            if (!this.DatabaseExists())
            {
                throw new InvalidOperationException("Cannot use the SchemaContext on a database which doesn't exist");
            }
        }
    
        public Table<Table> Tables;
        public Table<Column> Columns;
    
        [Table(Name = "INFORMATION_SCHEMA.Columns")]
        public class Column
        {
            [Column(Name = "TABLE_NAME")]
            public string TableName { get; set; }
    
            [Column(Name = "COLUMN_NAME")]
            public string Name { get; set; }
    
            [Column(Name = "DATA_TYPE")]
            public string DataType { get; set; }
    
            [Column(Name = "ORDINAL_POSITION")]
            public int OrdinalPosition { get; set; }
    
            [Column(Name = "IS_NULLABLE")]
            public string IsNullableString { get; set; }
    
            public bool IsNullable
            {
                get { return this.IsNullableString == "YES"; }
                set { this.IsNullableString = value ? "YES" : "NO"; }
            }
    
        }
    
        [Table(Name = "INFORMATION_SCHEMA.Tables")]
        public class Table
        {
            [Column(Name = "TABLE_NAME")]
            public string Name { get; set; }
    
            [Column(Name = "TABLE_TYPE")]
            public string Type { get; set; }
        }
    }
    

    You can then read the schema with the following code:

    using (var schemaContext = new SchemaContext())
    {
        foreach (var table in schemaContext.Tables)
        {
    
        }
    }
    

    It’s important to create a separate context for these tables, as otherwise the DataContext.CreateDatabase call will attempt to create these schema tables, which will fail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From what I've read so far, Windows Phone 7 does not support a Sql
I would like to develop for Windows Phone 7 but the lack of database
I know Windows Phone 7 supports Linq but I've heard there are some limitations,
I would like to know whether Windows Phone 7 OS supports Sampling frequency of
I'm trying to make a basic client-server application for windows phone 7 (using Mango
I am working on a Silverlight based Windows Phone application that only supports landscape
How i can achieve relations in windows phone mango application. I tried with LINQ
I'm developing a Windows Phone 7 project which uses a local SQLite database. The
Ok so Sencha Touch 2 doesn't officially support Windows Phone , although it may
In Windows Phone I populate my Pivot control with an ObservableCollection model that gets

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.