How can i connect my MSSQL database to an application? i have allready an IIS installed and i have a url with .php encoding and exporting data with json format. how can i show the results to an appery application?
How can i connect my MSSQL database to an application? i have allready an IIS installed and i have a url with .php encoding and exporting data with json format. how can i show the results to an appery application?
Hello Stelios,
You should create REST service in appery.io and specify appropriate parameters: http://docs.appery.io/documentation/r...
Evgene, thank you very much for your quick reply.
I had created a REST service, using the url and i have a parameter "q"
when i set a value to this parameter (lets say, 1) in the test response, i get the desired result as json
Also i have set the table field in the "Response" tab (e.g. user_name)
The thing is.. i just want to make this user_name field come up to a label or text component
i do bind the field and set the event to invoke the service at startApp but nothing happens
Is there anything that slipped my mind??
Please specify what do you mean on event "AppStart"? Also please try using event "page show".
Forgive me, the event is "Load" on the startScreen component.
thats where I invoke my MSSSQL service. i have some screenshots that might help you a bit.
on this picture i have my url with the .php file (inside the php is just a select statement)
the php takes this "q" as parameter (input)
the database has these three fields. i created these automatically from the json response.
here you can see the binding with a textfield from the form.
BTW, my php has the following result when my parameter q=1
{"0":"ADMIN","USR_NAME":"ADMIN","1":"Administrator","USR_FULL_NAME":"Administrator","2":1,"ID":1}
So, when i set hardcoded the input q = 1, and start the test.. shouldn't the text field show me the word "Administrator"???
Am I missing something?
Thank you..
Hi,
If you use your server, you would need to use Appery.io proxy for cross-domain requests:
http://docs.appery.io/documentation/s...
http://docs.appery.io/documentation/c...
Hi Katya,
Thank you very much for your reply.
As i understand correctly I just need a proxy service between the json parsing and the REST service. So i made one as you can see below:
Here i just created a proxy with a name
Here, i added the two request parameters if I understand correctly (appery-rest with the guid and the appery-tranformation, both headers)
When i test, I get the desired result as json (I remind you that the json export is coded inside the php file [json_encode])
I also changed the settings of REST, Data Type from json to jsonp.
Is there anything else that is not done yet? Is there any problem with my export format?
Thank you
Hello!
1) You don't need Proxy if you use JSON
2) Did you recieve response you expected from server? If you didn't, please check your servise response for example in postman and post it here.
Hi Maryana,
So, ok I uncheck the Proxy option.
I receive the expected response from server as you see in the last screenshot of my previous post. It is in json format and the field is USR_FULL_NAME : Administrator
Now, i have binded the this field with a label on my program as you see on the last screenshot on my first post.
When i test the program, shouldn't it show the word "Administrator" ? Instead, it says "Labgel1"
Somehow the result of my SQL Service (REST) does not pass to the label ![]()
Hello Stelios,
Have you called your service, for example before show your page?