【发布时间】:2017-08-29 09:28:02
【问题描述】:
有没有办法从代码中缩小数据库?我在我的数据库中发现一些表已损坏:如何从代码中检测到并修复它?
当我尝试使用Execute 更新特定表中的记录时,我总是收到Corrupt 错误。
表的定义是
[Table("tbl_Colour")]
public class Colour : BaseTableListing {
}
public class BaseTableListing : ITableEntity
{
[PrimaryKey, AutoIncrement]
[Indexed]
public int Id { get; set; } = 0;
public string CreatedBy { get; set; } = "";
public DateTime CreatedDate { get; set; } = DateTime.Now;
// more fields
// ...
}
查询是
UPDATE tbl_Colour SET IsUpdated = 0,
SynchronizeDate=CAST((((JulianDay('2017-04-04 09:22:12', 'localtime')
- 2440587.5)*86400.0) + 62135596800) * 10000000 AS BIGINT)
WHERE ID = 57;
提前谢谢你。
【问题讨论】:
标签: ios sqlite xamarin.forms