none
SQL Database support in Metro Style App?

    Question

  • Can I write Metro Style MS SQL (or Oracle) database based apps?

    If yes, any example?

    Thanks,


    Slava Vitebski
    Wednesday, September 14, 2011 9:17 AM

Answers

  • @katabuki - I will assume your question is if you can directly connect to a database using something like ADO.NET or such in your Metro style app? With that assumption, you cannot directly have a SQL db embedded in your app or use something like ADO.NET.  This is more of an async/services infrastructure.  So if your data was exposed via services, then of course you could connect that way.  There are some other light-weight methods you could use for local storage as well using things like the Windows.Storage namespace (which is similar to Isolated Storage in .NET).

    Wednesday, September 14, 2011 2:19 PM

All replies

  • @katabuki - I will assume your question is if you can directly connect to a database using something like ADO.NET or such in your Metro style app? With that assumption, you cannot directly have a SQL db embedded in your app or use something like ADO.NET.  This is more of an async/services infrastructure.  So if your data was exposed via services, then of course you could connect that way.  There are some other light-weight methods you could use for local storage as well using things like the Windows.Storage namespace (which is similar to Isolated Storage in .NET).

    Wednesday, September 14, 2011 2:19 PM
  • Does that mean it is impossible to have metro style applications with a significant amount of local client (SQL) storage?  I guess I'm thinking about large, but single user, applications (eg a personal cashbook) where the data is on the local user's PC.

    Friday, September 16, 2011 4:19 AM
  • I totally agree, we really need something like the SQL Ce 4 + Linq to SQL thing we have in Mango (with better support for asynchrony).

    Well, it's still a developer preview, and I can't imagine that the RTM will come at least at parity with what we have on Windows Phone.

    Friday, September 16, 2011 6:35 AM
  • I don't understand why Microsoft is trying to push everything to the cloud. We need a local database, we need ADO.NET. I have a big desktop application that is using an Access database and I won't be able to do a Metro version of that application without any database support. Please enable at least SQLite. It makes no sense to sync the data to the cloud to exchange it between the desktop app and the metro app on the same computer. The database should sit locally in the users documents folder and both applications should be able to access that local data. You are doing the same mistake as on WP7.
    Friday, September 16, 2011 2:06 PM
  • I agree with divinglog2. I would love the flexibility of using a tradtional Desktop Application or a Metro App to expose the data stored on a local sql server.


    Developer
    Tuesday, September 20, 2011 1:46 AM
  • @Tim - In terms of local access to DBs are you saying that for Metro apps:

     

    A - Definitely not planning to add this support.

    B - Still thinking about it/deciding.

    C - It's coming, just wasn't ready for the preview build.

    • Proposed as answer by foxjazz2 Wednesday, September 21, 2011 5:41 PM
    Wednesday, September 21, 2011 1:16 PM
  • I don't think disallowing developers to extend metro apps ability to talk with other applications on the pc is going to be a well accepted in the developer community. Storage on disconnected devices is imperative, many of my business users work in a partially disconnected environment.

     


    foxjazz
    Wednesday, September 21, 2011 5:44 PM
  • I think at least in the early days MS wants to see apps which are Lightweight, connected to cloud(read Azure). Having said this if WP7 is any indicator we can expect to see some support for local databases in winRT.

    I found Perst to be a usable alternative, it works on Silverlight and WP7 and seem to be high performance.


    Sameer V.
    Monday, October 10, 2011 2:54 PM
  • @Tim - could you answer Sean McLeod question?

    So no even SQL Express built in as part of the services?

    No connection with the Desktop ?

    All that is a showstopper for a business application and make Metro just a target for Facebook/Angrybirds type of application (social & games)

    Forcing the business  app to be 100% of the time connected to use the cloud is simple wrong.

     

     

    Wednesday, October 12, 2011 6:48 AM
  • "In the early days MSFT might focus on the "light" stuff. But its no time for another year to get a SP out to support more features. They are already late in the business for such a consumer oriented device... And even WP7 has a database (finally).

    I fear that we will see the same on Win8 as we saw on WP7. Slow pace towards a huge update what should have been include from the start...

    It can't be that difficult to implement a strapped down version of the EntityFramework like its on WP7 with SQLCE below it. After all - you have the source of all that stuff already...

    Otherwise we will all use something like perst or build our own framework ontop of binaryformater - and redo everything a year later with a "real" db...

    And there are such nice frameworks like sync framework already available from you guys - perfect for occatinally connected devices...

    • Proposed as answer by Delordson Sunday, November 13, 2011 4:22 AM
    Wednesday, October 12, 2011 10:39 AM
  • You can use SQLite. Here's a wrapper: http://sqlwinrt.codeplex.com
    • Proposed as answer by foxjazz2 Thursday, October 13, 2011 7:23 PM
    Thursday, October 13, 2011 4:42 PM
  • You can use SQLite. Here's a wrapper: http://sqlwinrt.codeplex.com
    This has to be the answer!
    foxjazz
    Thursday, October 13, 2011 7:24 PM
  • You can use SQLite. Here's a wrapper: http://sqlwinrt.codeplex.com


    @Atamiri: How does this work? Is SQLite actually present in Metro apps?

    I do agree with other developers in this thread. It would be nice if someone from Microsoft actually answered the other questions (from Sean McLeod) and I agree completely with the necessity for offline storage.

    At BUILD, there was a whole session dedicated to offline storage in HTML5 (http://channel9.msdn.com/events/BUILD/BUILD2011/PLAT-376T) and nothing for C#/XAML apps.

     

    Friday, October 14, 2011 3:24 AM
  • It's a wrapper, i.e. WinRT classes on top of C code.
    Friday, October 14, 2011 8:25 AM
  • Does it work for you?

    I get this Exception, when I try to buid the app:

    Error 1 The type 'Platform.IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'platform, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'. 

    I don't have a "platform" assembly anywhere, only "TestPlatform"...

    Friday, October 14, 2011 8:41 AM
  • Add a reference to Platform.winmd (this is unrelated to the wrapper, you need this reference if you are using a C++/WinRT component in a C# project, there's a thread on it in this forum).
    Friday, October 14, 2011 8:51 AM
  • thanks... that worked!

    Can't find the thread you mentioned though... The search on this forum seams to be broken. Can't find anything really.

    Friday, October 14, 2011 9:06 AM
  • Yes, the search is broken.

    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/1900bd21-8693-4127-800a-f35cfd5daac2

    Friday, October 14, 2011 9:13 AM
  • Fyi, on 'search is broken', we addressed an issue yesterday with how we surface content to bing. It may take a while for their crawler to catch up to the fix though. As a reminder, issues with the actual forums can be asked/posted to here:  http://social.msdn.microsoft.com/Forums/en-US/reportabug/threads   Until Bing can re index the fixed pages you can likely get better results by bouncing out to the category page http://social.msdn.microsoft.com/Forums/en-US/category/windowsapps and searching from there. It isn't perfect, we know this and are constantly working with the search crawler contacts to improve this.
    Community Forums Program Manager
    Friday, October 14, 2011 4:57 PM
  • I don't understand why Microsoft is trying to push everything to the cloud. We need a local database, we need ADO.NET. I have a big desktop application that is using an Access database and I won't be able to do a Metro version of that application without any database support. Please enable at least SQLite. It makes no sense to sync the data to the cloud to exchange it between the desktop app and the metro app on the same computer. The database should sit locally in the users documents folder and both applications should be able to access that local data. You are doing the same mistake as on WP7.
    Me too...
    Monday, January 16, 2012 2:32 PM
  • Microsoft hasn't figured out that programmers like simplicity, not complexity.

     

    They are forcing metro apps to use RIA technology to talk to backend services for data, from my understanding there is no way to allow for System.Data.SqlClient services because of some security concerns.

    They also don't seem to think that database servers should be local with metro apps, possibly because they want apps to be compatable with all devices.

    I think they are limiting possibilities and forcing programmers to conform to the new way of accessing data (on their terms) so they are forcing compatiblity.

    It's just another form of communism.

     


    foxjazz
    Wednesday, January 18, 2012 6:24 PM
  • Windows Metro application can be deployed with local SQLite database. We recommend using LinqConnect - Devart's LINQ to SQL compatible solution which supports SQLite. You can employ LINQ and ADO.NET interfaces with our product. Starting from the 4.0 version, LinqConnect supports Windows Metro applications: LinqConnect for Metro: Quick Start Guide.

    Devart Team
    http://www.devart.com/dotconnect
    ADO.NET data providers for Oracle, MySQL, PostgreSQL, SQLite with Entity Framework and LINQ to SQL support

    Friday, July 20, 2012 1:40 PM
  • SqlLite is open source. It is quite possible that it can be modified so Metro will take it.


    foxjazz

    Monday, July 30, 2012 4:19 AM
  • I don't understand why Microsoft is trying to push everything to the cloud. We need a local database, we need ADO.NET. I have a big desktop application that is using an Access database and I won't be able to do a Metro version of that application without any database support. Please enable at least SQLite. It makes no sense to sync the data to the cloud to exchange it between the desktop app and the metro app on the same computer. The database should sit locally in the users documents folder and both applications should be able to access that local data. You are doing the same mistake as on WP7.
    I agree totally.  This is a killer.  My whole application that I wanted to put forwarded centers around a local access data store.
    Saturday, August 04, 2012 5:14 PM
  • @Tim - could you answer Sean McLeod question?

    So no even SQL Express built in as part of the services?

    No connection with the Desktop ?

    All that is a showstopper for a business application and make Metro just a target for Facebook/Angrybirds type of application (social & games)

    Forcing the business  app to be 100% of the time connected to use the cloud is simple wrong.

     

     

    Agree 100%
    Saturday, August 04, 2012 5:15 PM
  • Metro is only a 'marketing model' making us possible to sell simple and sometimes not very usable apps for mobile devices. Anyone who wants to develop a new MatLab or AutoCAD can do this with well known tools, languages and frameworks.

    One can say the same about a cloud. The cloud is also a 'marketing model' of selling old and well known services called web-, app-  and/or database hosting. There is nothing really new in cloud as there is nothing very innovative in Metro or Win8.

    We (developers) should love Metro because we can (potentially) get some money and satisfaction from our apps downloaded and bought by the publicity. This biz model is very well tuned: The app must be SIMPLE. Too many possibilities would kill the App Store business.

    Wednesday, August 08, 2012 7:10 PM
  • That's fine if you want to sell apps in the app store - not something I care about at all, or most .net/vs developers I expect.

    I suspect (but don't know!) that most devs use VS in a corporate, intranet environment (I'd love to see if there's some actual stats for this?).

    Presumably the full ADO.Net / C# model will be available in a non-metro ('desktop') model?

    Tuesday, September 04, 2012 6:16 PM
  • Purely my opinion - but SqlLite, while handy for small projects, is not even remotely capable of being a replacement for SQL Server or Oracle (or Postgresql for that matter).
    Tuesday, September 04, 2012 6:18 PM
  • @Tim - could you answer Sean McLeod question?

    So no even SQL Express built in as part of the services?

    No connection with the Desktop ?

    All that is a showstopper for a business application and make Metro just a target for Facebook/Angrybirds type of application (social & games)

    Forcing the business  app to be 100% of the time connected to use the cloud is simple wrong.

     

     

    100% Agree as well! Windows 8 could be a new business computer model for providing a lot of useful business tools! And It will be a great success! Why not providing the MS SQL Express on every Windows 8 platform? 

    • Proposed as answer by foxjazz2 Wednesday, November 07, 2012 6:21 AM
    Thursday, November 01, 2012 2:07 AM
  • I think that deploying sql server on every windows 8 PC rocks.

    foxjazz

    Wednesday, November 07, 2012 6:22 AM
  • if we can get data from web services then how about installing SQL Server on your windows 8 box and expose the data as webservices (hosted in IIS)? then in metro you could reference your webservices and etc to exchange the data. You will enjoy the luxry of Metro UI + Services in Traditional ADlO.net way
    Thursday, November 08, 2012 2:25 PM
  • Technically there are many options to implement data persistence as many of you already mentioned, using custom data storage, any custom open source solutions, web services etc. 

    For me all the above options a "hack" and a prove that the platform is not mature (or serious) enough. If I want start new project (from scratch or porting, doesn't matter) which is not entertainment but for a medical market - I need standard solution. I must be sure it will be supported as long as platform does. There are many reasons for that, but the main one is money. Developing for medial market is expensive and time consuming and requires many certification tests to pass such as FDA. Medical solutions are not alone, there are many other areas where standards are super important. And we are not talking about some minor feature here, database is not something you can develop quickly and dirty.

    This means that most enterprise as well as other specialized projects will be on hold or will to other platforms.

    In fact, those are very loyal customers as they invest much money for long term and Microsoft decide to ignore them.


    Slava Vitebski

    Thursday, November 08, 2012 5:00 PM
  • I'm working on a personal productivity app. By design, it uses data service. However, user has access to whole work history and should be able to search through that instantly. And this requires local storage too. 

    1. Incremental search against the service simply won't be fast and fluid enough for this use case (productivity scenarios, a lot of search)

    2. Constantly hitting the server with search queries from all customers requires more server side resources than affordable in such type of app  

    3. Anytime user can be offline but still should be able to use the app and actively access data from the past 

    Lack of local RDMS really complicates developer's life.   

     

    Thursday, November 22, 2012 10:53 AM