Which local database is suitable for Windows 8 Store Apps? - c#

I'am programming a Windows 8 Store App (Metro Design) with C# and XAML using Visual Studio 2012.
There is no need for a database server with multi user support etc.
I want to store my data in a local database and don't know which database is suitable for my needs.
Maybe SQLite? Or are there solutions that fits better for Windows Store Apps and integrates better in Visual Studio?
The app is kind of a calender and the database should store the user data that consists of the dates, tasks and so on.

SQLite is supported for WinRT.
http://visualstudiogallery.msdn.microsoft.com/23f6c55a-4909-4b1f-80b1-25792b11639e

SQLite is the recommended database to be used for Win 8 Apps.
Links for implementing the same
http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
http://code.msdn.microsoft.com/windowsapps/Using-SQLite-Asynchronously-b8372137
https://visualstudiogallery.msdn.microsoft.com/23f6c55a-4909-4b1f-80b1-25792b11639e

Ok, this is a great question that I had to learn the hard way. By default WinRT applications do NOT have access to, directly at least, to any type of database structure. This means no Express, Compact, CE, SQLite etc.
There are three ways around this. Do not use a database and instead use a local file structure where you store and retrieve your data. XML works very nicely with this because you can maintain many of the same features a database would give you.
The second option is to use IndexedDB. It is similar to a cookie style local storage model where files are saved in your apps local apps folder.
The third and final option is to use web services. WinRT does have access to the internet which means you can write API and WebServices that can be called. This does mean that you need to have a server running which is connected to a master database. When your app needs data it calls your web service and obtains what it needs.
Overall, for the application you are describing the first option may best suite your needs. Keep a local XML file in your apps folder and read/write from it.

My question was marked as a duplicate of this question (although it was about C++ not C#). I thought I should still post my findings here. C++ apps have another alternative:
Extensible Storage Engine (ESE)
The list of all such API available for Store apps can be found on this link under the section Jet.

As one of variant:
Devart LinqConnect for Metro – a fully-functional high-performance ORM solution for developing Windows Store applications using either of LINQ or ADO.NET to access data.
http://code.msdn.microsoft.com/windowsapps/A-Simple-Windows-Store-85f29843#content
or next link can be usefull to
http://social.technet.microsoft.com/wiki/contents/articles/18417.windows-store-app-with-a-sqlite-database.aspx

Related

Sharepoint form writing to sql database

I want to build a form that will edit a table on SQL server. I known how to do it in ASP.NET (I need two drop down lists, gridview and button) but I want to make it as a part of SharePoint.
Can someone tell me what is the best technology to do that, I was looking at InfoPath but it seems I can not run it in web browser (only InfoPath filler). I just want to build simple form that is a part of Sharepoint and that is working in web browser. Please help.
Best regards
Daniel
One easy approach to read/write from/to SQL databases in SharePoint is to sync the external data with SharePoint lists. In this way you have the full feature set of lists available with best performance and highest security. Users are just working with a synchronized copy of the external data in the lists. To sync the data you can program by yourself, use PowerShell or 3rd party sync tools like the Layer2 Cloud Connector.
It is not a best practice in SharePoint to directly change the database.
One way you can do is Connecting to SQL Server Using the External Content Type Feature
http://www.dotnetcurry.com/sharepoint/794/sharepoint-2010-connect-sql-server-external-content-type
If you want to change directly , As you already know how to do it in Asp.net , you can go for Visual Webpart with same asp.net gridview and connection string

storing application data in metro application C#

I'm totally new to Windows 8 programming and I am writing Diary application for Windows 8 on C# right now. It stores diary's notes which user writes. The question is following: how do I store this notes so that user (and program) can easily access any of them via dates? I've thought of storing each of them in a separate file or all of them in one, but this seems not a good idea for me. Using some sort of local database would be nice, but is there anything like this among inbuilt Metro development tools?
You can use SQLite as your database: http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx

Windows application storage location

I am working on a windows app. The user has to register first to use this application. So in order to store user information, I am using MS-Access as a database. There is not much information to be stored as this application will be on individuals machine. There are few settings and some user information to be stored.
What I am feeling is that with the use of MS-Access, my application will be dependent on other application as MS-Access. It is not necessary to have the MS-office on the end user's machine.
So can you suggest me the best way to store the data safely without any dependence.
One thing I want to clear is that, the information will be of different types like it will consists of user information, some folder/files paths and some other information. I would like to keep these information separate from each other.
Thanks
Abhie
I think I found the solution.
Best practice to save application settings in a Windows Forms Application
I hope this will help others facing same problem.
Stackoverflow Team You are doing fabulous job. One suggestion; can you put some chat option for developers to discuss their problems. I think this would make it more easy to find answers to complex problems...:)
Regards
you need to include Access Database Engine drivers in the client PC, in order to connect it .
MS Access Database Engine
If you're using .NET, the best bet for getting the recommended folder locations for application data (e.g. your mdb file) is probably best retrieved using Environment.GetFolderPath
See:
http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx
You're likely interested in ApplicationData or LocalApplicationData for user specific data or CommonApplicationData for data shared by all users as your storage location (and then the proper company / product subdirectories appended to it).

What is the best way to develop a C# project with a MySQL backend?

So I'm using C# 2010 Express and wondering what the best toolset is for developing a C# project with a MySQL backend? I know what if you use SQL Server Compact edition from within C# it will let you access the DB directly from the IDE. Is there a similar way to integrate the development with a remote MySQL Database?
Also, is MySQL a versatile enough solution for writing a program with C#? I am looking to build a seperate PHP web site (a reporting portal) that will access the MySQL data. I'd love to go open source all the way, but it seems like C# is the best app to create the app I'm trying to create (touch screen interface for data entry).
Whenever I program a database related homepage I always use HeidiSql and mysql. Both of them are easy to figure out and fast to use.
From their site:
HeidiSQL is a lightweight, Windows
based interface for MySQL databases.
It enables you to browse and edit
data, create and edit tables, views,
procedures, triggers and scheduled
events. Also, you can export structure
and data either to SQL file, clipboard
or to other servers.
All you do is install Mysql, set up a pass and username. and it's up and running.
Then all that's left is to install Heidisql. Heidisql it is a free program. If you need more details on how to attach heidi to your database please do write again.
There is
http://www.devart.com/dbforge/mysql/fusion/
But it's not free and is a plugin which you can't use with Express. There is no way to do this with Express as you can't add onto the basic functionality.

what database should i choose?

I use winforms to develop a desktop application, and right now I plan to use SQL server express, but the problem is, if i use sql server express, then the installation is much trouble, i need to install sql server first, and install my own applicaiton.
Then I tried to use access 2003 as my database, then I only need to copy the mdb file with my application. But the access 's function is not that strong, the text length is limited to 255 byte.
Is there any other database solution, which is easy to integrate to my application, and easy to install after i develop my application ?
Many many desktop application have their own database, and easy to install and easy to use, what database do they use ?
SQLite. Extremely robust and easy to work with, and has C# bindings. It is now the most widely deployed embedded database. The DLL is under 300Kb.
Use SQL Server Compact Edition (CE). It's free, and comes with Visual Studio. It's file-based, but can easily synchronize with a "real" SQL Server database.
I was going to post a list of links to SQL CE information, but I found too many good links with the following search: http://social.msdn.microsoft.com/Search/en-US?query=sql+server+compact+edition.
you can try Non-Sql db, like Db4o, it's:
easy to set up
easy learning curve
C# native
Object oriented
Light weight

Categories