locked
C++ and SQL Database

    Question

  • For iOS development, I use the intragrated SQL Database. Do we have something similar in WinRT for structured data?

    Friday, September 23, 2011 10:19 AM

All replies

  • At the moment (based on the Build talks), WinRT has no support for SQL clients. This may change in future. The suggested approach is to use web/WCF services for database requirements.
    http://blog.voidnish.com
    Friday, September 23, 2011 12:31 PM
  • Looks like there is no Database api in WinRT.

    This is good and bad. It means WinRT can stay clean of ever changing DB apis from the .net world and provide consistent dev. experience across HTML5/Javascript and XAML/C# world.

    While HTML5/JS has access to IndexDB, .net devs will have to use custom solution based on Json/XML and LINQ. If Windows Phone any indication, we should expect to see some sort of DB access in WinRT before launch.


    Sameer V.
    Sunday, September 25, 2011 6:40 PM
  • I think DB access is way too useful to be ignored from the final release.
    Microsoft MVP VC++ | www.mariusbancila.ro/blog | www.codexpert.ro
    Sunday, September 25, 2011 7:10 PM
  • For iOS development, I use the intragrated SQL Database. Do we have something similar in WinRT for structured data?

    You can use SQLite in WinRT. Here's a wrapper: http://sqlwinrt.codeplex.com/

    Thursday, October 13, 2011 4:30 PM
  • You can use SQLite in WinRT. Here's a wrapper: http://sqlwinrt.codeplex.com/


    Can this wrapper be used in a metro styple application? If yes, how does it replace the Win32 API in SQLite kernel?

    Because the APP will not pass Windows App Cert Kit if SQLite kernel still uses unsupported Win32 API.

     

    Friday, October 14, 2011 8:28 AM
  • Did you open the link? It can be used *only* in Metro style applications. It's open source, you can check out the source code and examine it.
    Friday, October 14, 2011 8:39 AM
  • Did you open the link? It can be used *only* in Metro style applications. It's open source, you can check out the source code and examine it.


    Yes, I have checked the source code, but it does not contain the SQLite kernel code (sqlite3.c, sqlite3.h)

    My question is, if the kernel still uses the unsupported Win32 API, like loadlibraryW, GetTempPathA, even though the wrapper can work fine in my metro app,

    it will not pass the metro app verify tool. Any solution?

    Thanks.

     

    Friday, October 14, 2011 8:59 AM
  • You have to download the SQLite source code from their site. I'm using  SQLite 3.5.8.

    There will be no loadlibraryW if you define SQLITE_OMIT_LOAD_EXTENSION (the preprocessor will omit the code). There's one line with GetTempPathA but it's not used so you can comment it out. The linker fails if it's there.

    The compiled DLL doesn't use unsupported API.

     

    Friday, October 14, 2011 9:11 AM
  • Why not code it in OLEDB or ODBC?

    I am planning to do so soon by moving some sample OLEDB and ODBC sample library that I posted in Codeplex as "C++ Min-Framework".  I also has an older post in CodeComplete (something like "Raw OLEDB").  Since today there is no client-DB in WinRT coding OLEDB or ODBC can be an alternative.

    Still I also vote that this should be in the first release since it is kind of fundamental.


    Eduardo Sobrino
    Sunday, October 16, 2011 12:43 PM