With regards to a windows phone 8 application, how can I write user input to an external SQL database and also read and display database query data on to the phone?
To be more specific, is there a file similar to a web.config where I could provide a connection string to access a database located on a server?
I would like to create an application where downloading the application and logging into an account will provide access to user data from any windows phone device.
10,000 foot view looks something like this:
Your Windows Phone 8 app contains a reference to a web service. Could be WCF, Web API, etc. This will be hosted externally on whatever platform you decide to develop it with.
Your app will call methods defined in the web service to access the data.
That web service contains the data access code and may connect directly to the database.
So like Yuriy said...don't connect directly to an external database. You need to develop a web service to do your data access and then consume the web service from your app.
Related
I have a cross platform app currently designed using xamarin forms but now need to use this to create a user profile for the user, using the information provided, for a website.
Are there any add ons or plugins for something like square space or wordpress which would allow me to upload a user program via a RESTful api or something along those lines?
Basically what are my options to transfer user data from a cross platform app to a web app so that my user can then log onto the web app and see all their information?
All you need is a database that can be accessed by both your web app and your mobile app. There are numerous services that would allow you to do this.
But if your web site is going to be a WordPress site (I have never looked into squarespace) then it already uses a MySql back end for data storage. I would imagine squarespace uses a database of some sort as well. You could then create RESTFul urls on that same server to send and request data and use whatever database system that your website is using. If you don't want to implement your own service code for sending and receiveing data that can be used by both your web app and your mobile app, then you could use some service like Azure, AWS, Apigee, etc. just for the database.
What is the best possible way to connect your windows phone 8 application with the database?Which is the best option? I want to make synchronization possible to that app database and azure SQL database.So the ultimate goal is to update the azure database and view the output on phone app even while it is offline.
Provide appropriate links & tutorial wherever possible.
Build an ASP.NET MVC WebAPI server, hosted as an Azure website, which connects to your database. Then the Windows Phone can talk to the server using a RESTFUL interface, ie JSON carried by HTTP.
Store data on the phone in local storage. I really would not try to run a database on Windows Phone.
See Microsoft ASP.NET Web API > Overview and Getting Started: http://www.asp.net/web-api/videos/getting-started
Wikipedia > Representational state transfer: https://en.wikipedia.org/wiki/Representational_state_transfer
MSDN > HttpClient Class: https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx
I have just completed my first WCF REST api that makes use of JSon for posting data back to a client app. As part of the dev process I made a quick sample c# forms app for testing. I serialize the incoming Json response and bind to gridview. An example would be of retrieving Balances for the associated ID's of accounts. I have yet to host this, but the idea is to host it on a client server, and for them to be able to develop 3rd party apps.
I really really want to develop a simple sample Windows Phone or Android app, for showcasing as well as learning how to access this hosted service. I have found plenty of articles on accessing via being connected to wifi. But, say I want to develop an app and distribute this on an app store. For users connecting via mobile connection, say 4G, how would this be achieved? If I host via IIS on a server, would I be able to use the URL in a client Android/Windows phone etc. app, authenticate via an API key and retrieve the data?
Please can someone advise on how to go about or where to start please?
Thanks in advance.
You would buy windows web hosting and deploy the WCF REST app there, it would be available on a global domain like http://myapp.com/wcf-app.
Android & iPhone apps would connect to the global address and view the information from the JSON requests, as could any one with a browser.
I want to be able to connect to my DB on the azure platform and pull down some data from a table, using a windows store app in c#.
I have done this before in asp.net, but I know that the libraries for this type of thing are different when using windows store app.
Could anyone point me in the right direction?
Thanks,
Callum
You won't be able to connect directly to your Azure database from a Windows Store app, because a firewall prevents direct access - you need to add each IP address individually. It would also be incredibly insecure.
Instead, create a simple API which your Windows Store app can call - use WebAPI in C# for example. You can host this on an Azure Web Site, and it can act as the gateway between your Windows Store app and the database.
What i want to do is running a windows service (c#) which gathers some information which i want to display in my asp.net web forms site. The windows service has a timer so that code can be run periodically.
The purpose of my application is to manage windows services (restart, check if they are stuck etc.). Furthermore there is the exact same monitoring service on a different server which checks the other one (monitoringService1 monitors monitoringService2 + some normal services and vice versa). This is why the monitoringService is a service too.
Can you guys give me any hints how i can pass my data from the win service to my web forms?
Thank you in advance!
best regards,
r3try
You can store the data from the results of your Windows Service in a log or a database, then read the same data from your asp-net application. I would recommend the database way.