I'm working on an app using Xamarin that will run on Android and Windows Phone 8. The app has a local database. It works fine on Android, but I'm facing a crash on WinPhone. When the app tries to update an item on database, it says "no such column: SendBill".
By debugging the app, I can see it calls connection.CreateTable<TTable>();
, where TTable is a type of RouteMobile.
My RouteMobile:
public class RouteMobile: IModelBase
{
public RouteMobile() { }
[PrimaryKey]
public int Id { get; set; }
public int Code{ get; set; }
public string Identifier { get; set; }
public string DtExec { get; set; }
public string Situation { get; set; }
public int SendBill{ get; set; }
public int QtdBillsToPrint { get; set; }
public int QtdNotificationsToPrint { get; set; }
public int QtdDebitNotificationsToPrint { get; set; }
#region Sincronization
public Int32 IdServer { get; set; }
public DateTime SyncVersion { get; set; }
public Boolean UpdateFlag { get; set; }
#endregion
[OneToMany(CascadeOperations = CascadeOperation.CascadeRead)]
public List<RoutePointMobile> RoutePointList { get; set; }
}
My IModelBase:
public interface IModelBase
{
int Id { get; set; }
}
Then, the app app calls connection.Update(item);, where item is a instance of RouteMobile, it crashes:
{SQLite.Net.SQLiteException: no such column: SendBill
at SQLite.Net.SQLiteConnection.Update(Object obj, Type objType)
at SQLite.Net.SQLiteConnection.Update(Object obj)
at IM.Data.BaseMobileDAO`1.Save[T](T item)
at IM.Business.RouteMobileBO.Save(RouteMobile item)
at IM.Business.RouteMobileBO.AjustRoutes(IList`1 lstRout)
at IM.ViewModels.RoutListViewModel.get_ListRouts()}
Running on Android, it runs fine. On WinPhone it crashes.
Any idea?
Thanks!
Aucun commentaire:
Enregistrer un commentaire