Search code examples
c#sqlazurewindows-store-appswindows-store

Connect to a SQL DB hosted on azure through a windows store app


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


Solution

  • 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.