I am unable to debug it also.
connection.Open() Here i am getting exception while running from Tizen Emulator.
GetMySqlConnection() will return the mysqlconnector instance.
public async Task<List<SensorData1>> GetAllSensorData()
{
var connection = GetMySqlConnection();
List<SensorData1> sensorDataList = new List<SensorData1>();
try
{
if (connection != null)
{
connection.Open();
var command = new MySqlCommand("SELECT * FROM SensorData1;", connection);
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
sensorDataList.Add(new SensorData1()
{
AQI = reader["AQI"].ToString(),
PM2_5 = reader["PM2_5"].ToString(),
PM10 = reader["PM10"].ToString(),
Client_ID = reader["Client_ID"].ToString(),
Device_ID = reader["Device_ID"].ToString()
});
}
}
}
}
catch (Exception ex)
{
//throw;
}
finally
{
if (connection != null)
{
connection.Close();
}
}
return sensorDataList;
}