Can I use Sql Server Database from iOS? - ios

There are a lot of ways to have a database on server ( I can use my own server or I can use MS Azure (for Azure I found REST API Description https://msdn.microsoft.com/en-us/library/azure/gg715283.aspx , but I didn't find a way to add some rows to a table or to get information from the table)), but I want to edit the database and get proper rows from the server database from iOS code without having server API. There are a lot of ready solutions such as Backendless.com , but they are not stable.
So is there any way to connect to the remote SQL server database on the remove server or to MS Azure database and to edit rows and fetch data?
May there are some framework for iOS to do than? (for example in .Net there are Linq framework and Entity Framework).

In your question, you linked to a management API for SQL Database service - this has nothing to do with data manipulation; it's strictly a management API for dealing with servers and databases.
If you want to direct-connect from an IOS app to SQL Database Service (or SQL Server in a VM), you'd need to find a client library for IOS (and recommendations of such a library are not in scope for StackOverflow). There is no native SQL Server client library specifically provided through the Azure SDKs / APIs.
Outside of a native client library, there is Azure Mobile Services, which provides an API stack specifically designed around use by mobile apps (whether IOS, Android, Windows Phone, or even JavaScript). The API stack provided here, by default, gives CRUD operations for SQL Database tables. Additionally, it supports adding custom API calls, where you have complete control of your API calls.
Any other API stack would require you to choose the stack and run it yourself (whether in a Linux or Windows VM, Cloud Service, or Web App - there's no single right way to do this).
Documentation for Azure Mobile Apps (and related API feature, such as monitoring) is here.

Since you are developing in Azure consider automatic REST API from SlashDB, which is available from their Marketplace.
https://azure.microsoft.com/en-us/marketplace/partners/vte/slashdb-slashdb-azure/
SlashDB reflects the entire database as URL-linked structure so a lot of queries need not even be written. It supports SELECT, INSERT and UPDATE. In addition to that it allows for defining an API end-point to call a stored procedure or return results of a SQL query.
Disclosure: I am the founder and CEO of the company behind SlashDB, but you don't have to take my word it - just try it.

Related

iOS - use Aceess database and sharepoint to push and pull data

Currently I am creating app that needs to store and pull data from database by multiple users.
Since I do not have much knowledge in database, MS Access, and MS Sharepoint, I would like to know if it is possible to use share point as database for my iOS application, which implemented in pure swift code.
Any one with knowledge in this field please help me by providing advice on if it works, and, if possible, how can I successfully implement this.
Thank you for all the helps.
I don’t see why this would not work. As long as the SharePoint tables follow the rules for Access, then you can place the ms-access application on each desktop. Anytime “any” user of that application updates or adds records, then all other users will “eventually” see the updates. So in this setup, the desktop users can in fact “run” the application “off line”. The instant such users get Wi-Fi or a connection (or always have one), then the data is synced in real time.
The above setup takes no coding and is part of the Access system which supports those SharePoint tables.
As for the iOS and that part of the application? Again, I see little problem since all of the abilities of SharePoint are available as a web service. So as long as your development platform supports standard web services, then your application can interact with that web service to retrieve and update rows of data in those SharePoint tables. As noted, the “sync” to the Access clients will thus reflect any updates to that data.
Since near every modern phone development system supports interaction with web services, then the phone software can do the same. You not have an ODBC like interface, but you can query the data (CAMEL).
The Access desktop client will also be interacting with the SharePoint tables via a web service, but from Access point of view the SharePoint tables (lists) look like any regular SQL like table. So standard VBA code and DAO reocrdsets are supported.
The web services for SharePoint are outlined here:
https://msdn.microsoft.com/en-us/library/ms479390(v=office.12).aspx
And this video shows how you can upload data to SharePoint from Access, and NOTE how the relational table ability of SharePoint is supported by Access. Once that data is uploaded, then Access supports updating of such data as if the data was a local table.
https://www.youtube.com/watch?v=3wdjYIby_b0&list=PL27E956A1537FE1C5&index=2
You can use a single office 365 account at $6 per month for the above, and that single account supports 500 free users. So if you don’t have SharePoint (or don’t want to bother with SharePoint, a single office 365 account also offers these SharePoint services for that one stupid low price of $6 per month – and that account with work with the free Access runtime that that you can use to run the Access side for free on the desktop part of this application.

iOS (Swift) project needs to read an Azure SQL database

I am creating an iOS project that needs to read a SQL database in Azure. I have the database Server location, port, username, and password. I don't need to write to the database, just read it. I am more familiar with Firebase or Parse and have never used Azure. How do I even go about starting this? I tried the sample project that Azure makes for you but I don't have any tables? Do I need this? Any help would be welcome.
Azure Mobile App Service can connect with your existing SQL database
this thread explains the process where you use the existing SQL database. With this option Azure manages most of the inner workings for you.
If you want to build the Rest API from "scratch" using your existing SQL database You have some more options:
Azure API Management allows you to publish API's securely and at scale, A server less Azure Function like the example in this article Rest API with Azure Functions and Azure SQL Database or build a rest API using an Azure Logic App which doesn't require you to write code. You could also use Nodejs or many other tools you just need to evaluate what would work best for your use case.

Azure Mobile Services - Data Access - Developing for both mobile apps and websites

I'm developing with Azure Mobile Services (using SQL Azure) to provide a backend for both IOS and Android mobile apps and a PHP website.
My question is now that now custom apis have been introduced is it considered best practice to wrap everything up in custom api calls rather than e.g. using the CRUD table operation scripts directly from apps or websites?
Additionally for data access from a website should you lock down access to stored procedures and only exec via custom apis, to enforce a consistent approach no matter who the consumer is?
While I appreciate that custom apis and the table scripts are restful it still isn't clear how to architect a solution in the most efficient, reliable way that can enforce business rules in only place allowing each process only one entry point e.g. you have a stored procedure exec'd by an api called from the mobile apps. If the website calls that stored procedure directly without going via the api it could have unwanted side effects because other logic steps will have been missed.
I'm relatively new to Azure so forgive me if I have just missed something fundamental here. I've read many blogs and tutorials but they rapidly go out of date.
Many thanks
In my opinion the great feature of azure mobile services is the push notifications (to ios, android, wp). If you are not going to use that, there's no great advantage to use WAMS
(Windows Azure Mobile Services).
But it's a good choice using Windows Azure as backend since it's easy to scale up /down. In this case, you could create a Webapi and host in a Web Role. As it works with http, you can easily create Restful services and call them from your apps (ios / android).

Using QBWC 2.0 to sync QB files

I've just begun to read the QB Developer documentation and have come to the conclusion that to write a web-enabled application that will sync/remote backup QB files between two machines over the Internet, that the QBWC is the 'approved' way to accomplish this task. The .NET application samples in the QB SDK (V12) are not using WCF but WSDL and SOAP.
But before I commit to going that route, I am asking if anyone has a better approach. I'd prefer to use WCF and MS Sync Framework, but I don't want to head down that road if it will mean using a cannon to kill a mosquito.
Thanks
You really hinted at two separate goals here, so I'll address each specifically:
... remote backup QB files between two machines ...
If your goal is BACKUP then the Web Connector is certainly not the answer. The purpose of the Web Connector is to enable integration between QuickBooks and web applications, via the QuickBooks API/SDK. Since not all data stored within QuickBooks is accessible via the API, the Web Connector is not appropriate for backup. It is impossible to get a complete, accurate backup of the entire QuickBooks data set via the Web Connector.
On the other hand...
... web-enabled application that will sync ...
If your goal is to allow integration/sync of data between your web app and QuickBooks, the Web Connector is a decent solution. Yes, it uses SOAP (with a grand total of only about 5 very simple methods). No, you can't use WCF/anything else without writing your own version of the Web Connector.
If you add more details about specifically what you're looking to do with specifically what data, you'll probably get some better answers and suggestions about approach.

the reason not to access directly from xcode to mssql?

I am planning to build an iOS app with using DB(Ms-Sql).
However, people recommends not to access DB from Xcode.
They recommend me to use php or asp for accessing db through a webpage.
I want to know the reason.
Also I am going to use DB only for (view) select line (not insert, update nor delete).
so is it possible to access directly to db for viewing purpose only?
thank you
It's generally bad for an application (mobile, web, any client) to directly have access to any database for security issues. Clients really should not be accessing the database, which is often holding very private/secure data. It opens up vulnerabilities (i.e., sql injection attack).
A set of web services written in php or java or some back-end technology is a more secure, scalable system. These web services can connect to the database and retrieve data. Your iOS application can call the web services and receive the data..for example in the form of XML or JSON.

Resources