0

When connect to SQLite 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 '

this is nugget version

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 it = db.Query<ITEM>("SELECT * FROM ITEMS");
            }
4

0 回答 0