Windows 8 Databound App Tutorial - sql

Does anybody know of a good tutorial, preferably with downloadable sample code, for a Windows 8 app that is data oriented?
I am trying to rewrite a fairly simple Windows Forms application, which uses a local SQL Express database, as a Modern UI Windows 8 app, but it seems that Windows 8 apps don't support accessing SQL databases natively. This leaves me wondering what the best way to store the app's data is, and also lost as to how to handle calls to create/edit/delete records, etc.
I've come across the Reversi sample app, which Microsoft claims contains extensive examples of databinding, but actually it all seems to be in an MVVM context, binding visibility of controls, positions of items, etc. I'd like to see an example of a more traditional, simple database application with records that can be browsed, updated, created, deleted, etc. Not least so that I can just see how the data is stored, since an external database apparently isn't an option!

You can use SQLite as database for Windows Store App. There are couple of articles & code sample available.
SQLite samples from MSDN
Using SQLite in Windows 8 Store Apps
WinRT app guide: Step 10: Adding a lightweight database (SQLite) and CRUD support + two-way element binding

Related

Choosing database for the app that target windows phone7 and windows phone8 OS?

I have to develop and enterprise app that should work in both windows phone 7 and 8(app targeting to older and latest OS). This is an app porting from android to windows phone.
The proposed app has lots of database interactions like order processing and payments(bulk CRUD operation should be handled) in both offline and online mode.
Also, at the time of login , the app should check for the DB change in the server and need to make the corresponding changes in the local phone app database accordingly either by downloading the SqlLite file or any otherway from the server.
I heard that, Windows phone supports following approaches to deal with database interactions;
LINQ to SQL Data Context(WP7)
SQLLite(WP8)
SQL CE(WP7.5)
SterlingDB
And i would like to design the database/table using an IDE like SQLLite manager or sql server ,for easy of db design.
My Question is: which DB approach is good for my app to achieve the following requirements?
App target the OS WP7 and WP8.
DB design support(IDE to add/modify the DB or tables)
offline data Sync
LINQ Support.
DB changes in server need to be get updated in the local app(by downloading .sdf/.sql kinda file).
I've successfully used the SQLite C# Community port on both WP7 and WP8. I think it is a little out of date now - and doesn't seem to me actively maintained - but it has worked well for me. See http://code.google.com/p/csharp-sqlite/ for more info.
You can also use the native SQLite library on WP8 - and this is the officially recommended WP8 solution and is maintained - but I've found this requires more project level setup.
For LINQ support, I personally use SQLite-net - https://github.com/praeclarum/sqlite-net/ - but other solutions are available - e.g. Vici CoolStorage - http://viciproject.com/
For offline data sync and for sdf updates, I've not seen any automated solutions - I believe you may have to code this yourself.

Code examples using xcode and updating information in SQL Server 2008 R2

I am trying to make life a little easier for several coworkers and of course ME!. We need to update a database that controls our invoicing function. This database is housed in SQL Server 2008 R2. I need to provide users with a way (based on their function) to enter information affecting the invoice. For example, John has customer interaction and sends them a pdf of a document on Monday. We need to capture that John sent Customer A a pdf on Monday and it was associated with Project 123. Simultaneously, Ann is color correcting a piece for Customer A but on Project 126. I have over 50 people working in various areas who may or may not need to enter information. My hope is to make the application generic enough that the user simply selects from drop downs tied back to the original database.
The majority of the users (80%) use Mac OS. I have donwloaded XCode and I was hoping to use this to create the application that will update the backend database.
I am new to creating this type of application. I have done this with VB and VBA but do not have access to those tools here. So if there is another tact that I should take, I am more than willing to rethink my approach.
Key points are that I need to draw information from and update a SQL 2008 database. Second, I cannot use something like Excel as a front end, since I will have multiple users accessing information simultaneously.
You're unlikely to find many examples of connecting a Mac app directly to SQL Server, because that's a rare combination. Macs, unlike Windows PCs, aren't often used in an enterprise setting, so the software ecosystem to support enterprise development is much weaker.
If you're feeling brave, there are vendors out there that sell ODBC drivers for Mac OS X, some of which connect to SQL Server. So your problem becomes finding Mac ODBC examples, which is IMHO an easier problem. Google "mac os x odbc drivers". I have not tried any of them, so I can't speak to their quality.
This is going to be a lot of work, especially since you're new to the platform. You might want to consider exposing the database as an OData source (the name of the server-side technology is "WCF Data Services"). There are OData client-side librarires for the Mac. Google "mac os x odata". This approach completely bypasses the business of ODBC drivers, at the cost of some server-side development.

How to connect sql database compact edition on visual studio 2008 with vb.net (smart device)

I'm doing a project with vb.net (smart device) on visual studio 2008 and I need to connect to a database on the device itself (I do not have a physical device to test, only emulation). How should I go about doing it? I would like the database to be in the device on start up.
I've read on the internet that you have to make a reference to System.Data.SqlServerCe but the documents are, in my opinion, vague. So, I'm pretty lost here.
So there are two questions here:
How do I deploy my database so it's there when my app starts?
How do I access that database from my app?
Both are straightforward.
A1. You have a couple options. First, understand that SQLCE databases are a single file, typically with an SDF extension. You can either package it with your app for deployment, so you know it will be there on first run, or your app can check for its existence on startup and crete the file if it's not there. If you need to populate the initial database with data (lookups, etc) then option 1 is probably better. As long as you deploy/crete the database in a persistent storage location (and under WinMo/Pocket PC that's pretty much anywhere), it will always be there when your app starts up.
A2 You are correct that you need to add a reference to System.Data.SqlServerCe, which is again straightforward. Just add a reference in your smart device project:
Once you've done that, you use the SqlServerCe namespace objects to create the database, tables, indexes, etc, insert and query data, and all of that good stuff. Tutorials 2 and 3 on MSDN here are a really good start and they have VB.NET examples. The nice thing is that most desktop examples for VB.NET accessing a SQLCE database will work as-is on the device, and the things that don't work are usually in the presentation of the data, not the actual database access code itself.

Pulling Data From an SQL Database in HTML 5

I am trying to develop a BlackBerry application that will show data from an SQL Database from a server. I was researching the new HTML 5 option for blackberry (WebWorks) and noticed that it apparently cannot connect to any server data by itself. Some links state that I would need javascript coding to obtain it. I looked into the option of PhoneGap (link here: http://phonegap.com/) and decided I'd try using HTML 5 to produce the application. I have never touched SQL databases before and I am wondering how I would connect the two; meaning how do you pull data from the server given that you are working with HTML5?
I have looked at:
Where is data stored when using an HTML 5 Web SQL Database
Process for pulling data from a sql database
among others but I am still unsure as to what to do. I would be looking to "view" the data from the server and display it on the app. It would be something of the sort:
- HomeScreen: What data would you like to view?:
- Dropdown list of categories (from the database)
- Selecting Entry in dropdown leads to available information (from the database)
Any help would be appreciated, and of course thanks in advance.
the new (and pretty awesome) features of HTML5 is happening in the browser on the client side. What you will need is a back-end on the server side doing some magic. It is true that browsers now have databases but these are located on the phone, computer etc and as I understand your question you want these data to communicate with data on your server. To move data across the web you will need to perform HTTP-requests which can easily be done through javascript and ajax. Look a bit into these technologies and make a little server-side script that gathers data from the database and send it in a structured format to the phone (JSON, XML), then make a script in javascript on the client-side that parse these data and utilise them.
Good luck!

WPF or Silverlight, XML or SQL or Access, LINQ or not?

I am writing a Windows app and want to make sure I am choosing the right tools. Currently I am leaning towards WPF and XML, please let me know if I've made a good choice.
I have about 3,000 records. Each record has a Product Name and a Price columns.
All my app does is display these records in a DataGrid and allows the user to search for products by name. Meaning, if a user types 'chair' in an edit control, then only the Product Names that contain 'chair' and their prices are displayed in the DataGrid. That's it. Nothing fancy.
Should I use Silverlight instead of WPF? I understand Silverlight allows my app to run on any OS, while WPF requires Windows? Unless I create a WPF for browser project, I think.
Should I use XML or Access or SQL? Which database would make the SEARCH feature easiest, fastest, etc.?
Finally, should/does LINQ have any involvement in this project?
Thanks.
If its going to be a stand alone product i.e. installed a each computer and not networked in any way then personally I would go for a SQLCE database with a WPF client. Its up to you if you use LINQ, I quite like it but would be overkill for this app maybe.
The next stage up is a small app used by a handful of users in a network. In this instance I would use an access backend (assuming a fileserver is in place) with a WPF client application.
Right at the “top” of the scale would be something used by a lot of people and/or something on the web. In this case I would use SQL server as the backend and again a WPF client app or if you want it to run on other platforms then go for silverlight