Forum Xamarin.Forms

Connect mobile application to SQL server



  • KatekkoKatekko BRMember

    @nadjib said:
    Don't shock me...

    Are you gonna publish an app to the Stores, that accesses an SQL database directly, with a hardcoded connection string? ****super triggered****

    it's a app only for me!

    @AlessandroCaliaro said:
    > @Katekko said:
    > Yo guys
    > I hope someone can help me, I'm trying to publish my app using release mode, everything works fine in build. But when I try to do some connection to my database (sql server) it can not make the connection! Would anyone have any idea what it would be like?
    > ps: I can run in debbug mode normally !!

    Maybe some permission problems? Which is the exception?

    I think the referrals do not pass when I release compile> @FredyWenger said:

    You really should use a WebService to access your SQL server!
    I suggest you, to read the postings in this thread carefully :smirk:

    Yes, I'll take a look at how to use the web service instead of direct connections

    Ty alot guys, cya

  • PoojaMorePoojaMore Member ✭✭
    edited June 2018

    Hi @FredyWenger,
    Thank You for your useful information.

  • SagarPanwalaSagarPanwala USMember ✭✭✭

    @Katekko : Can you please post your code to connect Xamarin to SQL Server directly , I need to do it. I have ordered to do so without any web service. In my case user first setup the server configuration himself then try to connect. So this can't harm I think because I don't have to use fix connection string.

    Please guys help me to do this.

  • mukumuku Member ✭✭

    I am tired of you guys always saying ,you can't make a direct connection to sql,but when we ask you for a working code ,you dont even produce a code .You only give some comments that does not help anyone.l am now in 3 months just wanting to do a project that captures data and views data using xamarin forms but each time l ask someone .You all say use web services but how ? you don't say .At least you should post the source code that is working ,anyone who has done a simmilar code please post something for us.We need a code that works ,not just these pillow talks.If you have a code that makes a direct connection and works .please give us.We are just tired of the people who only raise suggestion but no code

  • mukumuku Member ✭✭

    But if you have written an similar code on github you can just post the link same as we do,each code we make we always post the link on github so that others can be helped

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
    Unfortunately most of the code I write is proprietary for my customers and cannot be posted on GitHub. To extract the nuts and bolts of an implementation into a workable takes time - which I don't have.

    I do my best here to point people in the right direction but I can't write your code for you!
  • ST.7899ST.7899 USMember ✭✭
    > @Billy12Shovels said:
    > @AndrewWilson.2511 Hello, I don't connect to a SQL server directly from the application. I use the REST Web Service that my office created to connect to the SQL server, and then I connect to the Web Service with my application.
    > I'm not too sure if you can even connect to a SQL server directly from an app?
    > Does that make any sense?

    maybe late to reply this Post, but yes now you can connect directly to sql. using xamarin .forms with .net standard 2.0
  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    I think you can use System.Data.SqlClient
  • This post have a couple of years active haha. Well anyway I have a question, what's the difference from an API to a web service?

    I thought they were the same thing, but as you @FredyWenger said is something different, could you please give me an example of both?

  • TobyKTobyK GBMember ✭✭✭

    @pl4s1ic_Str4w API and Web service serve as a means of communication. The only difference is that a Web service facilitates interaction between two machines over a network. An API acts as an interface between two different applications.

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    API stays for Application Programing Interface and is used for many purposes. A software vendor defines some functions to his software in an API and let other programmers access the functions over the API. API's are mostly used local (not over the Internet). E.G. also Windows has an API.
    A Web service has methods ("functions") inside that can be accessed over http/https. A Web service can be accessed in a Intranet (e.g. in a LAN of a huge company) or (mostly) over the internet.
    So... principally API and Web service have a lot in common, but the architecture and the use cases are different.
    To let an App access central data (e.g. stored on a SQL server), Web Services are best practice.

  • Thank you! I think now I have clear about the two concepts. Both answer are really helpful

Sign In or Register to comment.