best practice connecting directly to sqlserver

deckelmouck 191 Reputation points

hello together,
i want to connect from multiple android devices to a ms sqlserver database in an internal environment only using wlan and no internet connection. are there any best practices for doing that?
with our old devices (win6.5) we use and SqlConnection. Reading data via SqlCommand and Execute.. (Reader, Scalar, NonQuery e.g.).
all I get for online services is to use a webservice, but i want to try it directly and to be always up to date.
Thanks in advance!

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,813 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,542 questions
{count} votes

Accepted answer
  1. deckelmouck 191 Reputation points

    tried two solutions:

    • first: according to stackoverflow article from 2016 with interface and use service from pcl to xamarin android function. works :)
    • second: only in pcl, use NETStandard.Library (2.0.3) and add NuGet package System.Data.SqlClient(4.8.2)
      now you get simple access to mssqlserver ;)

    and yes, I know, that this is not a secure way to get access to a sql server database on an internet connection, but i think it works for my purpose using it only on internal devices without access to public internet.



0 additional answers

Sort by: Most helpful