LinqConnect for Metro - WinJS support

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
DavidF
Posts: 18
Joined: Fri 11 Oct 2013 10:07

LinqConnect for Metro - WinJS support

Post by DavidF » Fri 11 Oct 2013 10:23

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

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

Re: LinqConnect for Metro - WinJS support

Post by MariiaI » Fri 11 Oct 2013 12:30

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.

DavidF
Posts: 18
Joined: Fri 11 Oct 2013 10:07

Re: LinqConnect for Metro - WinJS support

Post by DavidF » Mon 14 Oct 2013 08:38

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;
}
}
}

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

Re: LinqConnect for Metro - WinJS support

Post by MariiaI » Tue 15 Oct 2013 11:43

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.

DavidF
Posts: 18
Joined: Fri 11 Oct 2013 10:07

Re: LinqConnect for Metro - WinJS support

Post by DavidF » Tue 15 Oct 2013 15:01

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.

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

Re: LinqConnect for Metro - WinJS support

Post by MariiaI » Fri 18 Oct 2013 05:08

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.

Post Reply