I am using xamarin forms and I am having trouble access a table in the database of sqlite which already exists.
Exception is:
Unhandled Exception:
SQLite.SQLiteException: no such table: Boms
public StockDatabase()
{
var path = Path.Combine(System.Environment.
GetFolderPath(System.Environment.
SpecialFolder.Personal), "FuelStockApp2.db3");
Console.Write("OPening Database dbPath" + path);
database = new SQLiteAsyncConnection(path);
}
I use sql browser to create my table as per below.This is the call i am using to make it out to the table, using dapper.
public Task<List<Boms>> GetBomsFroMSQlLite()
{
return database.Table<Boms>().ToListAsync();
}
namespace StockAppDal.Models
{
public class Boms
{
public enum BomStatus
{
InAcitve = 0,
Listed =1,
Scanned = 2,
Completed = 3
}
public BomStatus Status { get; set; }
public long BomId { get; set; }
public long BOMLineID { get; set; }
public long StockItemID { get; set; }
public string BOMLineTypeID { get; set; }
public decimal? Quantity { get; set; }
public long UnitID { get; set; }
public decimal? MultipleOfBaseUnit { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public string Barcode { get; set; }
public long ProductGroupID { get; set; }
public string ProductGroupCode { get; set; }
public bool Scanned { get; set; }
public List<Warehouse> Warehouses { get; set; }
public List<BomDetail> Lines { get; set; }
public override string ToString()
{
return Code;
}
}
}
Is there anything I must to mark my class as being accessible here I am using Dapper as well.
Note 2: Why in this example its showing that one can access the database in such this way that I am doing
https://github.com/xamarin/xamarin-forms-samples/blob/master/Todo/Todo/App.cs