Trupti K. K. Trupti K. K. - 3 years ago 182
Apache Configuration Question

How to save data from visual studio apache cordova project to sql server throght web api?

I m new to apache cordova project in visual studio, i have doubt that how system can save data in my sql server from this project. I have already created web API to save data to sql server. How can I call that from apache cordova visual studio project.

Any reference links will be help full.

Answer Source

there are 2 options:

  1. in the index.html that is created by the cordova project, use 'ajax Post call' webapi or webservices with Cors enabled and json datatype.

  2. create a signalr Server winform or console or service, call this signalr Server in the index.html using JavaScript with Cors enabled. then inside your signalr Server, call any dll or webapi or webservices, whatever you want.

I would suggest option 2, since the signalr Server can also initiate a call to the index.html's JavaScript functions, so it's two way!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download