Page 1 of 1

Unable to establish database connection in Windows Store app

Posted: Sat 16 Mar 2013 22:36
by russelle
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.

Re: Unable to establish database connection in Windows Store app

Posted: Mon 18 Mar 2013 13:44
by MariiaI
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.

Re: Unable to establish database connection in Windows Store app

Posted: Tue 19 Mar 2013 22:19
by russelle
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.