tags:

views:

29

answers:

1

Hello,

I am trying to figure out how to utilize exisiting SQL Databases with my iPhone apps.

What i am trying to do, is have a search function. The user inputs a keyword, i would then query my SQL database dependant on the user input and return the results from a database.

How do i do this with the iPhone?

EDIT: I mean SQL Server 2005/2008 databases which are hosted online (remote).

Thanks,

-Mike

+3  A: 

You need to write a PROXY PROGRAM to do that. You can't connect directly to SQLServer from iOS.

By proxy I mean a program using some kind of server side technology (IIS, ASP.NET, Java, C#) to connect to SQLServer, and implementing a TCP/IP based protocol (could be HTTP also).

On the iOS side, you need a TCP/IP (or HTTP) client to perform requests to the PROXY PROGRAM. Those request will have the SQL query you want to do in some form of internal encoding you can invent. When PROXY PROGRAM receives a request, it process the SQL query and returns and send results based, again, encoded in some form iOS could decode and process the information.

Pablo Santa Cruz
This is really new to me, i have found this: "XML Web Services for Microsoft SQL Server 2005" http://msdn.microsoft.com/en-us/library/ms345123%28SQL.90%29.aspx. I think this will work?
Mausimo
Yes, XML WebServices are a good option. Besides the XML Web Services for MSSQLServer 2005, you need a SOAP Client for the iPhone (to consume webservices from SQLServer).
Pablo Santa Cruz