Выполните SQL-запрос Azure из C на смарт-часах Samsung Gear S3

Как выполнить запрос MSSQL изнутри в приложении Gear S3? В настоящее время у меня работает код C# для выполнения запроса из настольного приложения, которое выглядит следующим образом:

string connection = ConfigurationManager.ConnectionStrings["ABC_Data_Center.Properties.Settings.ABCDataCenterConnectionString"].ConnectionString;
try
{
    using (SqlConnection newSQLconnection = new SqlConnection(connection))
    {
        newSQLconnection.Open();
        SqlCommand command = new SqlCommand();
        command.CommandText = "select sum(weight) as int from harvest join field on (field.field_id = harvest.field_id) join location on (field.location_id = location.location_id) where cast(timestamp as date) = cast(@current_Time as date) and (location.account_id = @account_id)";
        command.Parameters.AddWithValue("@account_id", account_id);
        command.Parameters.AddWithValue("@current_Time", DateTime.Now);
        todaysHarvest.Text = Convert.ToInt32(command.ExecuteScalar()).ToString("N0");
    }
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}

Могу ли я добавить этот тип функциональности в приложение для умных часов, написанное на C с использованием Tizen?

0 ответов

Другие вопросы по тегам