Windows 8 Store Application Connecting to SQL Online Databse - c#

Ok I have searched and searched for an answer to my problem but can not find a direct answer.
Can someone please guide me in the direction I need to go with step by step solution somewhere that is useful?
My Question:
I built an Windows 8.1 Metro Application that needs to pull data and store data into a database I am hosting in MySQL online but I can not use things like My.SQL.Data.RT because it is not supported (I guess) because I get an error.
How do I connect to my online database to pull information from and store information to it? If I can not do this what options do I have?
Using local databases is not an option because everyone will be storing information in the database and pulling information from it from hundreds of different computers running the application.
If you could point me to a website that I can see it in step by step and please. I am using C#.
Thank you for your help. I have been racking my brain over this because the My.SQL.Data.RT works but the application fails to pass the Windows Store requirements with it pretty dumb if you ask me.

I'm not a Windows 8 store app developer so I am just trying to give suggestions.
From what I know, connecting directly to database server over internet from a client app is NOT A GOOD PRACTICE nowadays. Instead, people provide APIs to do it.
For example, Twitter provides restful APIs, so twitter clients can request http urls and get wanted data in JOSN format. The security of the the connection is ensured by oAuth (so that you don't transfer username and password in http request) and SSL/HTTPS.
In this way, the database connection is hidden from Internet. You will also benefit from the API layer if you want to develop another client on platforms other than Windows, e.g. iOS or Android.
By a quick google search, I found two guides about making a restful api with C#.
http://www.codeproject.com/Articles/112470/Developing-a-REST-Web-Service-using-C-A-walkthroug
http://www.asp.net/web-api/tutorials/hands-on-labs/build-restful-apis-with-aspnet-web-api

Related

Xamarin ODBC Connectivity

I'm looking to start a small application for maintenance techs to view production status of lines and whether they are running or currently throwing an error.
Essentially when a user keys in that the line is experiencing problems it will pass a value to the DB we have. The IOS app should be able to read the data from the table as to take it and then create visual warnings for techs to access view through the app. An example of this would be a small Green/Red Square representing the current status of a line
Does Xamarin.IOS support this via an ODBC connection? I have done some preliminary searches for accessing the data through a web server but I am not quite how this would be implemented.
Any help would be appreciated - Cheers,
It is better if you can write a separate backend server application to deal with DB. Expose that server through the Restful Web API and then access that Web API from the Mobile app. If you are planning to use an in-app local database, then you can write DB service with SQLite. Refer below link
https://github.com/praeclarum/sqlite-net

Web service for Laravel

Assume that I have a third-party database application with SDK that can be used to retrieve data out of the database in XML.
On the other side, I have developed a website using Laravel framework of PHP. The website is supposed to display data from the database of the application.
In regards to above I have the following questions:
As far as I understand, I can either store the requested data in my website database or just show it without storing. What technique do you suggest?
How do I achieve xml data transfer from the database server to the website?
Taking into account that I have experience of development in C#, I assume that I have to develop some web-service that would run on the database server, retrieve the required data and send it to my website. So the web-service has to receive the requests from my Laravel website, retrieve data from database server accordingly and pass the xml response to my website that would finally display it. Am I on the right way? If so, could you please guide me on how to code and bind these parts?
Thank you in advance.
I have to agree with #Serge in the comments - there are many ways to do this because it is a very broad question.
My answer was mostly going to deal with how regularly the third party database was going to be updated but judging from your comments, I'm assuming it will be fairly often? In which case, I would likely connect directly to the third party database from your laravel app using the firebird driver found here: https://github.com/jacquestvanzuydam/laravel-firebird (Please note, I have never used this so I cannot comment on it's quality) instead of writing a C# web service. I don't know much about firebird itself but you will likely want to connect using an SSH tunnel or VPN for security reasons.
Then I would either store data in MySQL if you know it isn't likely to change very often (in this case you would use a laravel command, run on a schedule, to pull data out of firebird every [X] days/hours/minutes depending on the data) or, if the data is likely to change on each potential web request, using some form of caching system (redis, memcache, file cache etc) to speed up the web requests.
Sorry if that isn't particularly helpful - if you can provide more information maybe I can help you out further :)
Good luck!

Notification on multiple android phones using GCM and web services + database data

I am developing an app for selling of products, but I am stuck up in a place where I am not understanding how to give notifications to android phone from database change(insert or update on that table) for new products availble and offers like discounts, schemes etc.
I followed androidhive.com and javapapers.com for the GCM push notifications concept and it is sort of clear:
PHP or C# or Java web service
MySQL or SQLServer Database
GCM
Android phone
The statement for my problem would be "App should receive push notifications for new products, and offers and discounts given by the person-in-charge for it"
My assumption for this problem is:The "offers and discounts" would be "inserted" to a table(tbl_products) in the database and same goes for new products, "inserted" into a table(tbl_offers) in the database.
As soon as that "insertion" is done, the web service (php and c#), which I don't know how it should know, but gets to know about the change and informs GCM, and GCM sends the notification to the respective users.
The logic behind this is not familiar to me. I would greatly appreciate it if someone would help me with the logic and point me in the right direction of the coding for Android and web service. Thank you in advance.
I have been there ,done that! The way you should to proceed is:-
Create your website backend, a web service connected to a database(You need to use and know SQL for this part). Define your database accordingly. PHP is the easiest way to get started. Look at the GCM backend tutorials on Google.
Create your mobile application which has google play services enabled to use GCM. Implement GCM in your android app following the tutorial at the Official Android Developer website. You need to create an XMPP or RESTful service to communicate with your server. Your server needs to support XMPP to communicate better with Google. HTTP(GET/POST/PUT) is a dirty alternative to get working when you do not have a VPS setup for languages like Java(Most hosting companies allow only PHP,HTML,JavaScript etc on shared hosting).Depending on your scale of operation you may have to rent a Virtual Private Server(VPS) for your web service.
Create a private backend application(can be web or a desktop application) to upload your offers and so on. Examples on www.androhive.info
Make sure you got steps 1,2,3 correct.
Test your mobile application.
The idea can be pictorially represented as :-

Connecting from windows phone 7 to MYSQL

I am trying to connect a windows phone 7 app to MySQL database at a PC.
From what I found out after lots of searching, there is no direct way to do so. There is a lot of people saying restsharp could help communicating, but there seems to be very few info regarding the success and ways to do so.
I need to get the wp7 app to send data into MySQL db, so a website could take the data sent into the db and display it out.
Any kind people willing to give me some guidance or direct me to a known guide?
Thanks in advance
Typical way to do it is to setup your own website (better to be password protected, and over SSL). Then you use REST or simply HTTP POST to pass the data to your web scripts, which in turn connect to MySQL and do actual data INSERT.

Pushing TimeClock Data from Mobile Phone to Quickbooks

I need to find a solution or develop one for allowing employees to enter their "hours worked" at the end of the day and then easily and quickly "pushing" that data to Quickbooks Pro 2010.
I'm trying to formulate, in my mind, how to build this type of solution. With my understanding of QuickBooks integration I think it will look like the following:
Quickbooks Software on PC
|
|
Custom App "Linking" Online DataStore to QB (on same PC as above)
|
|
Online Data Store Such as MS SQL Server, MySQL, or CSV Files
|
|
Website or Web Service Used to Receive Data From Blackberry Phones
|
|
App on Blackberry Phone to Enter and "Push" Data To Data Store in the Cloud
Do you see any flaws in this design? Any ideas how to improve on it or simplify it?
Remember, the application on the PC will likely be on a consumer or small business network that doesn't even have static IP.
On a separate note, as near as I can tell nothing yet exists that will do what I'm looking for. The apps I have looked at require you to import iif files into your phone (specifically ReportAway). During an initial test of the app, the import failed to import anything but did not produce any error messages. It's unclear to me how the data gets input from the BlackBerry app to QuickBooks but it appears to simply be CSV files. If someone does know of an existing app for this I'd appreciate knowing about it. However, we may still opt to program our own anyway.
You're on the right track with what you proposed. I have a few further suggestions:
Instead of building a custom app that sits alongside QuickBooks, why not re-use something that's already built? For instance, the QuickBooks Web Connector or (if you're building a SaaS service) the Sync Manager via the Intuit Partner Platform? Both of those are specifically designed to enable web/remote applications to communicate with QuickBooks. There are C# examples of doing almost exactly what you're talking about included in the QuickBooks SDK, and open source QuickBooks libraries for doing what you're asking.
Why would you ever want to use CSV files for storing data? Do yourself a favor, and use a database.
You could easily make the phone end of things available via more than once interface- build a web interface for iPhones/web browsers, and an app for Blackberry if you want. Once you have the infrastructure, the actual interface/view should be trivial to implement.
Have you looked at the available Workplace.Intuit.com apps for time tracking yet?
are you wanting to build your own app? Your best option is the build your phone app that makes a call to a web service hosted somewhere on the network where QB is hosted, the service can use the QB API to put the data where you need it. Or simply create a website that they can browse to that will make the call to the API, then you dont even need to bother with a phone app.
Phone/Website > Web Service > QB/SQL
I have solved exactly this problem in the past, in a manner very similar to as described by DustinDavis. In my case, I simply connect the smartphone client app to the php app server. App server stores the data immediately. In a separate scheduled process, app server refreshes and pushes data to QuickBooks server every 15 minutes or every 30 minutes as configured. I can provide more details if you are interested.

Categories