best practice connecting directly to sqlserver

deckelmouck 191 Reputation points
2020-11-25T10:22:49.207+00:00

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 system.data.SqlClient 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!

Xamarin
Xamarin
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
    2020-12-11T11:25:55.707+00:00

    hello,
    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.

    Regards

    47340-carbon.png


0 additional answers

Sort by: Most helpful