Unable to establish database connection in Windows Store app

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
russelle
Posts: 9
Joined: Sat 16 Mar 2013 22:27

Unable to establish database connection in Windows Store app

Post by russelle » Sat 16 Mar 2013 22:36

In my Windows (8) Store app Visual Studio 2012 project I added references to Devart.Data and Devart.Data.SQLite. In my App.xaml.cs file I included

using Devart.Data.SQLite
using Devart.Data;

I tried to establish a database connection by

SQLiteConnection NPDConnection = new SQLiteConnection();
NPDConnection.ConnectionString = @"Data Source=J:\Software Development\NonProfitDemographics\NonProfitDemographics.db;FailIfMissing=True;";

I get the error "The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data'.

However, when I add a reference to this assembly I then get the error

"The base class or interface 'System.ComponentModel.Component' in Assembly 'System' referenced by type 'System.Data.Common.DbConnection' could not be resolved."

Any suggestions what I might be doing wrong? Thanks.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Unable to establish database connection in Windows Store app

Post by MariiaI » Mon 18 Mar 2013 13:44

Please specify whether you are using LinqConnect for Metro for developing Windows Store apps (support for Metro-style applications is available in LinqConnect for Metro edition only, dotConnect for SQLite does not support Metro-style applications).
For correct work with your project you should add 'Devart LinqConnect for Metro' to the References of your project (Add Reference->Windows->Extensions).

Please refer to the LinqConnect for Metro quick start guide.

russelle
Posts: 9
Joined: Sat 16 Mar 2013 22:27

Re: Unable to establish database connection in Windows Store app

Post by russelle » Tue 19 Mar 2013 22:19

Yes, that was the problem. I downloaded LinqConnect for Metro and referenced it and it seems to be working, although I am now getting an Access Denied error trying to connect to the database (subject of another post). Thanks for your help.

Post Reply