Display Data from Microsoft SQL Server 2012 on Mobile App

I am a IT-Trainee, so unfortunately therefore new in this topic. For my employer, I need to create a special mobile application self-studying.

I made it to already have some kind of login form so far, but now I need to display some data. Later login credentials need to be validated with this server, too, but for now it would help if someone just could tell me how to connect and afterwards how it's possible to get data and display it in an mobile app (only android is needed).

I am working with the following:

  • Microsoft Visual Studio 2017
  • Microsoft SQL Server 2012

I provide some code so it's maybe easier to help me:

MainPage.xaml

<ContentPage.Content>
    <StackLayout>

        <Label Text="You are here:" HorizontalOptions="Center" />
        <Label Text="[dbname].[dbo].[Adressen].adrsuche1" HorizontalOptions="Center" />

    <!--<Label Text="Later some data from the sql server should be displayed here too" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />-->

        </StackLayout>
    </ContentPage.Content>
</ContentPage>

SQLQuery.sql

SELECT adrsuche1 FROM Adressen

Sorry for my language and potential describing problems, hope you can nevertheless understand what I am meaning.

Best regards and thanks in advance

Best Answer

Answers

  • TBMSamTBMSam Member ✭✭
    edited September 2018

    Thank you for your fast answer.

    If I click Extras -> Connect to database, that's something different right? Because I managed the connection, and if I execute the query it gets the right data. I just didn't new the link between sql and xaml.

    But as recommended I will try to develop a web service now for this purposes, thanks again for your help.

    And sorry that I mixed up xamarin.forms and xamarin.android, didn't knew the difference. Maybe some mod could move this question to the right place.

  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭

    @tbmsam => don't mention it everybody begins one day :)

    there is a forum about xamarin forms ...

    i don't see what is Extras => connect to database ? on visual studio ?
    For me, and i have begnin as this , looks all video in youtube there are a lot of resources ...
    Try to make little sample and after build your own app :)

  • TBMSamTBMSam Member ✭✭
    edited September 2018

    @ChristopheBERNARD

    Sorry I have a German version of Visual Studio^^

    I'll attach some screenshots, maybe then you know what I mean:



    I was just confused, because there seems to be some tool for sql integrated in Visual Studio.

    My English, as you see, ist not the best, but no problem I will manage it to get through those guidances on youtube/web thanks again for your advice :-) As you know and mentioned, the first steps are always the hardest xD

  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭
    edited September 2018

    @TBMSam ahh ok i see, no problem for the language , my level is english is poor unhappy !

    yes you can add sql database over this menu, but this database will be not inside your mobile device.
    by this menu, you create a database but a local database NOT inside the mobile.

    If i well understand, you'd like to make a call with the mobile as this
    a) mobile make an http request over internet
    b) this request, downloaded datas from a database sql server locate somewhere

    there is a free url where you can download some fake objects
    https://jsonplaceholder.typicode.com/posts

    Perhpas , try to make a little sample before to attack your real app ..
    the best it's to

    • add an httpresquest to your mobile app
    • create database (sql lite) for the mobile
    • call the url
    • insert all datas downloaded

    that's all :)

Sign In or Register to comment.