C# 分析查询时出错。[令牌行编号=2,令牌行偏移量=17,令牌出错=NOT]

C# 分析查询时出错。[令牌行编号=2,令牌行偏移量=17,令牌出错=NOT],c#,linq,windows-phone-8,C#,Linq,Windows Phone 8,这是一个奇怪的错误,当我使用linq to sql创建本地数据库时,我正在使用wp8应用程序。如果我向datacontext添加了另一个表或更改了datacontext的名称,则它仅为单个datacontext创建。它向我显示了错误,我在标题中粘贴了什么我在这里添加了两个代码。 提前谢谢 我的实体类,如果我在Datacontext类中单独使用它,它运行良好 [Table] public class Employee { [Column(IsPrimaryKey = t

这是一个奇怪的错误,当我使用linq to sql创建本地数据库时,我正在使用wp8应用程序。如果我向datacontext添加了另一个表或更改了datacontext的名称,则它仅为单个datacontext创建。它向我显示了错误,我在标题中粘贴了什么我在这里添加了两个代码。 提前谢谢

我的实体类,如果我在Datacontext类中单独使用它,它运行良好

  [Table]
  public class Employee
  {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public int No { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolId { get; set; }

        [Column(CanBeNull = false)]
        public string LogoUrl { get; set; }
  }
DataContext类

    public class EmployeeDataContext : DataContext
    {
        public EmployeeDataContext(string ConnectionString)
            : base(ConnectionString)
        {
        }

        public Table<Employee> Employees
        {
            get
            {
                return this.GetTable<Employee>();
            }
        }
    }

private const string Constr = @"isostore:/LclDb.sdf"; // Connection string
我想添加的另一个实体

   [Table]
   public class School_Table
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public string SchoolCode { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolLogoUrl { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolNameUrl { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolWebsiteUrl { get; set; }

        [Column(CanBeNull = false)]
        public int LeaveStatus { get; set; }
    }

你能发布实体吗?当添加实体时,你会得到这个错误?只需编辑你的帖子并添加代码。您没有看到编辑选项吗?错误不仅针对此实体,它将我与该员工实体和employeedatacontext绑定在一起。在所有其他情况下,它都会抛出错误……您不认为需要将
添加到
数据库上下文中吗?还有您共享的异常的更多细节吗?我在代码运行正常时共享了代码,我将School_表添加到datacontext,在执行代码时添加了它,代码显示了错误。没有什么比它一次又一次地显示同样的信息。。。。我想这可能是因为emulator,但我也重置了emulator,但是……你能发布实体吗?当添加实体时,你会得到这个错误?只需编辑你的帖子并添加代码。您没有看到编辑选项吗?错误不仅针对此实体,它将我与该员工实体和employeedatacontext绑定在一起。在所有其他情况下,它都会抛出错误……您不认为需要将
添加到
数据库上下文中吗?还有您共享的异常的更多细节吗?我在代码运行正常时共享了代码,我将School_表添加到datacontext,在执行代码时添加了它,代码显示了错误。没有什么比它一次又一次地显示同样的信息。。。。我想可能是因为emulator,但我也重置了emulator,但。。。。。
   [Table]
   public class School_Table
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public string SchoolCode { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolLogoUrl { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolNameUrl { get; set; }

        [Column(CanBeNull = false)]
        public string SchoolWebsiteUrl { get; set; }

        [Column(CanBeNull = false)]
        public int LeaveStatus { get; set; }
    }