Answered by:
Connect my SQL DB to my app

Question
-
Hi, I have created an app and to get the layout of the app done I've been using data from a file local to my app. I've since created a RDS on AWS and want to get that data to my app. I'm not sure how to go about doing that. I saw something about a service layer, I'm not sure what that is. Any help or examples would be appreciated.Wednesday, May 15, 2013 2:31 PM
Answers
-
So I ended up using ODBC:
install: http://dev.mysql.com/downloads/mirror.php?id=412782
setup: http://msdn.microsoft.com/en-us/library/ca6axakh%28v=vs.80%29.aspx
Then just connect in VS through tools connect to DB.
Thanks for steering me in the right direction Girija :)
Edit:
Although I thought this solved the problem, there was more to it, this was definitely the start of it though, here's the continued solution: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/b3ebf263-0ae1-4512-acfe-3eaf2135b4f7
- Marked as answer by ZachAtttack Friday, May 17, 2013 3:13 PM
- Edited by ZachAtttack Wednesday, May 22, 2013 8:08 PM
Friday, May 17, 2013 3:13 PM
All replies
-
Hi,
You need to have a service layer which will act as a source for you app. This service layer can be a WebAPI, WCF , WCF Rest service or a SOAP service that will return data to your app. You can host the service in Windows Azure
Check out these links or just bing it. You will get some approaches
http://msdn.microsoft.com/en-us/library/windows/apps/hh868282.aspx
http://blogs.jinishans.com/2012/10/consume-json-web-service-from-windows-8.html
- Edited by Girija Beuria Wednesday, May 15, 2013 7:04 PM
Wednesday, May 15, 2013 7:03 PM -
So with using Windows Azure I can have it connect to my SQL DB on AWS rather than have Azure create a DB from scratch?Wednesday, May 15, 2013 7:55 PM
-
What is AWS ?
Depends on where you want the data from . If you database is on cloud (like on SQL Azure ) you can have the retrieving logic in the service code (connection to database and retrieving ).
If your database is on-premise and you want to access that, you can either use Azure Service Bus, or you can also have a service on your premise with an endpoint available for internet consumption.
Anyway works, as long as the service is available over internet. Windows Azure lets you easily configure and deploy and maintain these.
- Girija
Wednesday, May 15, 2013 8:10 PM -
Oh sorry. AWS is Amazon Web Services. I have a relational database setup there. I connect to the database using MySQL Workbench, so I know it's available to contact online. I just figured there are probably specific things I need to download in the Library Package Manager and I'm not sure what.
So I'm assuming because my database is hosted somewhere besides Azure I'll need my retrieving logic in the service code, where is this "service code"? In my Windows Store App code?
Thursday, May 16, 2013 1:21 PM -
So you are already using a cloud service.
You can create a rest WCF service that retrieves data from the RDS on AWS and host it in AWS also. Then you just consume that in app using WinJS Xhr.
I do not have any idea on AWS but I hope you can host a rest service on that.
- Girija
Thursday, May 16, 2013 6:51 PM -
So I ended up using ODBC:
install: http://dev.mysql.com/downloads/mirror.php?id=412782
setup: http://msdn.microsoft.com/en-us/library/ca6axakh%28v=vs.80%29.aspx
Then just connect in VS through tools connect to DB.
Thanks for steering me in the right direction Girija :)
Edit:
Although I thought this solved the problem, there was more to it, this was definitely the start of it though, here's the continued solution: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/b3ebf263-0ae1-4512-acfe-3eaf2135b4f7
- Marked as answer by ZachAtttack Friday, May 17, 2013 3:13 PM
- Edited by ZachAtttack Wednesday, May 22, 2013 8:08 PM
Friday, May 17, 2013 3:13 PM