How do I process the xamarin forms that connect to SQL Server and export data to the listView ? I'm looking for this simple example. What do I find on google ?

Hi,
To connect to a SQL Server from a Xamarin app (using Visual Studio, so some instructions might change), I followed this process:

  1. Add in a System.Data reference to your project
  2. Add in a using directive "using System.Data.SqlClient"
  3. Define connection string and open the connection using SqlConnection(connectionString)
  4. Manipulate database as normal

My code connects to a SQL database located on a server (not localhost) and then searches for an account number to check if it exists. The code is:

string connectionString = @"Server=<ipAddress>;Database=<DBName>;User Id=<username>;Password=<password>;Trusted_Connection=true";
string databaseTable = "<yourDBTableName>";
string referenceAccountNumber = "0001134919";
string selectQuery = String.Format("SELECT * FROM {0} WHERE [Account_Number] = '{1}' ", databaseTable, referenceAccountNumber);

    try
    {
        using (SqlConnection connection = new SqlConnection(connectionString))
        {                   
            //open connection
            connection.Open();

            SqlCommand command = new SqlCommand(selectQuery, connection);

            command.Connection = connection;
            command.CommandText = selectQuery;
            var result = command.ExecuteReader();
  //check if account exists
            var exists = result.HasRows;
        }
    }
    catch (Exception exception)
    {
        #region connection error
        AlertDialog.Builder connectionException = new AlertDialog.Builder(this);
        connectionException.SetTitle("Connection Error");
        connectionException.SetMessage(exception.ToString());
        connectionException.SetNegativeButton("Return", delegate { });
        connectionException.Create();
        connectionException.Show();
        #endregion
    }`