Xamarin form Can't connect to sqlite
See original GitHub issueWhen connect always got this exception
{System.TypeInitializationException: The type initializer for ‘LinqToDB.Data.DataConnection’ threw an exception. —> System.TypeLoadException: Could not load type of field ‘LinqToDB.DataProvider.SqlServer.SqlServerTools:_commandBuilder’ (0) due to: Could not resolve type with token 010000fe from typeref (expected class ‘System.Data.SqlClient.SqlCommandBuilder’ in assembly ’ Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) assembly:System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Data.SqlClient.SqlCommandBuilder member:(null)
This is my code
IDataProvider dataProvider = new LinqToDB.DataProvider.SQLite.SQLiteDataProvider();
ConnectionStringSettings connectionString = new ConnectionStringSettings
{
Name = "Database",
ProviderName = "SQLite",
ConnectionString = "Data Source=" + path
};
using (var db = new DataConnection(dataProvider, connectionString.ConnectionString))
{
var td = db.Query<ITEM>("SELECT * FROM ITEMS");
}
And this is linq2db version
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
And when you try to debug it, exception reports assembly version, not even included in nuget…
Ouch. Sorrry about that. Can you rollback to lin2db v2.5.4 while it is not fixed?