Question

I understand that to connect a Windows Phone or Windows 8 app to an SQL server you need to go through a web service. However I was wondering whether there are any other ways of doing this without using a WCF Service.

Thanks

Était-ce utile?

La solution

There are no native drivers for using a remote SQL server from a Windows Phone. Given the connected/disconnected state of a typical mobile phone, having a connection like would be done from a desktop application doesn't make as much sense.

So, it's very common to wrap the behavior with a web service. While you can use WCF, if you're just getting started and don't have existing WCF code, I'd strongly suggest you investigate using the WebAPI. It's a far simpler, yet expressive set of functionality designed to expose RESTful web services.

There are many dozens of alternatives as well that you could pursue if you wanted to use something other than .NET. But, if you're trying to connect to a SQL server, .NET will probably be the easiest.

There may be some other options that aren't true web services (like writing a custom protocol), but ultimately, they'll all have a service-oriented design, and as such, I'd stay away from them and try something like the WebAPI.

Autres conseils

Are you looking to avoid using services all together? Or are you just trying to avoid wcf? Technically speaking you could use any type of service, older asmx services would be an option or even non microsoft based technologies such as php or java could be used, although you may find they are not as easy to use as visual studio may not be able able to auto generate proxy classes for you.

If you are trying to stay away from services all together it might be helpful if you could elaborate more on why you don't want to use a service.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top