last day (27 days later) » 

3:21 PM
Hi
 
Wanted to chat a little to more understand the issue and try to help
 
ty for helping me
 
So, let's start from the very important thing
 
3:21 PM
Ok what I want to achieve: I'm trying to create a mobile backend
 
Mobile Services are deprecated and you should use Mobile Apps
 
and as a first step I Need a simple api which gets data from the database and Returns json
 
anyway, your mobile service will be moved to the mobile app in a nearest future, so it is intentionally that i gave you the mobile app stuff
good
that is mobile app indeed
 
@AlexBelotserkovskiy yep and the starter Project for html/JavaScript frontend is only contained in mobile Services...
 
ok, so you need to get simple api for getting records and settings records in the SQL Azure database, right?
 
3:24 PM
yep, in my post you see the model which the items should have
(projectitems)
 
good
so now the problem is that you do not see the tables in the sql azure
what i did not understand is what you mean by the "Why is it creating the tables running on localhost but when Publishing on azure it isn't?"
 
I want to get the projectitems which are created on the first Launch of the service
 
what do you have at localhost?
 
when Debugging the application before Publishing it there is in the app data Folder created a SQL table
which is containing the items
 
Ah! ok
sqllite, i see
ok, it is not going to work that way
 
3:27 PM
I thought by Publishing the appservice and selecting the empty database it will create the tables there
 
yep but how does it work?
why would I create a model in the app Service when it is not using it :)
 
you should differentiate the appdata and external database. what do you have in appdata is the something that will go with your application, and have nothing with the sql azure
yes, that is the good question, let me explain a little
 
when you use the mobile backend like a mobile services/mobile apps, mobile services is a broker between your client and the database. when you want to insert the record to the database, you put your record into something like JSON packet and send it to the broker. Broker then form the query from that JSON packet and execute against the database
and, instead of putting your data into the JSON stuff manually (and to form the {"name":"blabla", etc}) you have the mobile services sdk
sdk works by putting your object instance into the JSON and sends it to the broker
and when you get the record from the database, you ask the backend and it returns the same JSON packet to you, and SDK see that it is the object of the class you defined in your application, and then, using that class, it creates the instance of that object and populates that with the data that it got from the backend
does it makes sense?
what you have in appdata is the lightweight database, and actually is not recommended for the production use because every instance of your application should have its own instance of that appdata db
 
3:34 PM
As a result this calls in the example should return the projectitems in json, is looking like this in JavaScript:
var client = new WindowsAzure.MobileServiceClient('https://xxxx.azure-mobile.net/', 'XXX');
var todoItemTable = client.getTable('projectitem');
 
yes
but it does not create the table
it is just getting the... hmmm, i think "reference" for that table
 
I'm still reading your Response w8 a sec
ok so the model in my mobile Service is based on my database
and not the other way around
?
 
no, actually, it is your application object model is based on what you have in the backend
but there is one exception
if you have dynamic scheme setting enabled (on the mobile service dashboard somewhere in the Data branch), if, in your application class there is the column, for example, ColumnId, and there is no such column in the model in the Mobile Services, it will be created for you in the Mobile Services
and all of the older records in the database that did not have that column will be populated with the NULL value
 
ok, so how would I get my projectitemtable working?
 
1) create that table on the Mobile Services dashboard. Go to dashboard, then Data page, and here you should see that
2) create the object model in your app - looks like you already did that
ok, when you created the table, you should click on that and create columns on the Columns page
 
3:45 PM
ok
 
brb in 3 minutes
 
k
so i created a data page
 
k
you created the table with columns>
?
 
when I'm clicking at the table Icon it is just saying no tables, but there is no Option to add one
 
4:01 PM
you have the javascript or .net backend?
 
ouch
that gets more difficult
 
can you create the mobile service with the JS backend?
difference is not the language you use in your client
 
Is creating a mobile app simplifying it?
 
4:04 PM
no, it is the same
lets continue with the mobile services
when time comes, your mobile service will be migrated to the mobile app automatically
but for now lets simplify things
 
dump question: why are there only templates for native platforms like (Android/iOS/Windows uwp) . Is it supported to Access it by using the same JavaScript?
like for mobile Services?
in mobile app ^^
 
yes it is - it is just rest api
i do not know why they did not add the template for JS
 
Ok 'cause that confused me :D
 
mobile apps is anew service, so it looks like the documentation is still developed
yes it is confusing
1) create the mobile services with the JS backend
2) the same as above (data should be there, and add button should be there)
3) the same
.net backend means some coding and i would want to avoid that
 
@AlexBelotserkovskiy ty for your help but I guess I Need to read some documentation - you helped me to get a better understanding - at the beginning I got some confusing understanding of the mobile Service :D
I will give it a try later on ^^
 
4:11 PM
that happens :)
 
please mark the question answered if so. Would be happy to help
 

  last day (27 days later) »