C# SQLite for Windows Phone中的列名重复
我正在尝试使用SQLite for Windows Phone创建表:C# SQLite for Windows Phone中的列名重复,c#,sqlite,windows-phone-8.1,C#,Sqlite,Windows Phone 8.1,我正在尝试使用SQLite for Windows Phone创建表: [Table("Accounts")] public class Account : ObservableObject { private int id; private string name; private double balance; [Column("id"), PrimaryKey, AutoIncrement] public int ID {
[Table("Accounts")]
public class Account : ObservableObject
{
private int id;
private string name;
private double balance;
[Column("id"), PrimaryKey, AutoIncrement]
public int ID
{
get { return this.id; }
set { Set(() => ID, ref id, value); }
}
[Column("name")]
public string Name
{
get { return this.name; }
set { Set(() => Name, ref name, value); }
}
[Column("balance")]
public double Balance
{
get { return this.balance; }
set { Set(() => Balance, ref balance, value); }
}
}
Connection = new SQLiteAsyncConnection("database.sqlite");
await Connection.CreateTableAsync<Account>();
CreateTableAsync方法引发SQLiteException,并显示一条消息:列名重复:id。怎么了?对不作为表列的属性使用[Ignore]属性id属性作为表列。此外,我在MVS2013中创建了一个新项目,代码与上面相同,没有出现异常;ID为否。无法为私有财产添加[忽略]。正如我所说,在新项目中并没有提出任何例外。