views:

98

answers:

3

Is it possible to connect to Sql Server for the purpose of executing simple Sql commands within a native iPhone app?

If so, how does one go about it? I'm stumped. More generally, I would at least like to see how this is done with GCC.

Thanks in advance, Rich

A: 

FreeTDS has a Darwin port, but I think is only for the OS X, not for iPhones.

Your (much) better option would be to go through the web service route.

Remus Rusanu
Thanks for the response. I neglected to mention that I'm using GCC on Windows.
kim3er
A: 

I asked similar question on Serverfault.com, One of possibility is to set up SSH server on on your windows server and after that to telnnet in windows and use sqlcmd command prompt utility for MS SQL

adopilot
Thanks for the response, though I am starting to learn to towards the Web Service option. I had hoped that I wouldn't need to set up any extra software on the server, beyond SQL Server access permissions and the VPN.
kim3er
+1  A: 

My goal with this question was to create an iPhone application that could connect directly to an instance of SQL Server and execute SQL commands against that instance.

I don't believe for one second that this is impossible, but if it is possible, the solution requires more knowledge of C than I currently poses. This experience has shown me how much I take the .NET Framework for granted, and just how powerful and extensive the .NET Framework actually is. That such a connection would be so trivial in one framework, and so convoluted in another.

Being primarily a Web Developer, Web Services are well within my comfort zone. Initially I was not willing to consider them, as my secondary goal was that any solution I came up with should not require bespoke software on the server.

ALas, Web Services seem to be the most practical route for me at this point. So, my solution has been to create a Web Service that accepts SQL, and to put that Web Service in a VPN.

Rich

kim3er