Page 1 of 1

LinqConnect for Metro - WinJS support

Posted: Fri 11 Oct 2013 10:23
by DavidF
Hi,

I have been evaluating LinqConnect for Metro as a local storage solution for our Windows Store App. Unfortunately for us the SQLite provider only appears to support xaml apps wheras our application in a hybrid WinJS / c# WinRT component app.

When constructing a DataContext from a WinRT component the following exception is thrown

System.Exception occurred
HResult=-2147418113
Message=Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Source=Windows.UI.Xaml
StackTrace:
at Windows.UI.Xaml.Application.get_Current()
at Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider.Initialize(Object connection)
at Devart.Data.Linq.DataProvider.7axdkwt3gfx52xqzykge2d4jpayt4hd5 (IDataServices , Object )
at Devart.Data.Linq.DataContext. (Object , MappingSource , Type )
at Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
at ClassLibrary1.OfflineDataContext..ctor(String persisterConfigData) in c:\Users\xxx\Documents\Visual Studio 2012\Projects\App20\ClassLibrary1\OfflineDataContext.cs:line 29

The property Windows.UI.Xaml.Application.Current is not supported in WinJS apps.

Is there any workaround (e.g. an alternative SQLite provider) or do you have plans to support WinJS in the future?

Thanks,

David

Re: LinqConnect for Metro - WinJS support

Posted: Fri 11 Oct 2013 12:30
by MariiaI
At the moment, LinqConnect for Metro can be used in XAML C# and Visual Basic applications only.
We will consider adding the WinJS support in the future. We will inform you about the results as soon as any are available.

Re: LinqConnect for Metro - WinJS support

Posted: Mon 14 Oct 2013 08:38
by DavidF
MariiaI wrote:At the moment, LinqConnect for Metro can be used in XAML C# and Visual Basic applications only.
We will consider adding the WinJS support in the future. We will inform you about the results as soon as any are available.
Thanks for the reply. I have found an ugly workaround that suggests it wouldn't need a big change. Although this seems to work I'm still a bit uneasy about using this in production code and hence recommending purchasing licences for the development team.

public class NewProvider : SQLiteDataProvider
{
private const int CatastrophicError = -2147418113;

protected override void Initialize(object connection)
{
try
{
base.Initialize(connection);
}
catch (Exception ex)
{
if (ex.HResult != CatastrophicError)
throw;
}
}
}

Re: LinqConnect for Metro - WinJS support

Posted: Tue 15 Oct 2013 11:43
by MariiaI
We have fixed the issue with the WinJS applications and LinqConnect for Metro. The fix will be included in the next build of LinqConnect for Metro. We will inform you when it is available for download.

Re: LinqConnect for Metro - WinJS support

Posted: Tue 15 Oct 2013 15:01
by DavidF
MariiaI wrote:We have fixed the issue with the WinJS applications and LinqConnect for Metro. The fix will be included in the next build of LinqConnect for Metro. We will inform you when it is available for download.
Thanks for the speedy response. We will now be placing an order.

Re: LinqConnect for Metro - WinJS support

Posted: Fri 18 Oct 2013 05:08
by MariiaI
New version of LinqConnect for Metro 4.3 is released!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=28128.