Hi,
There seems to be an issue with SfChart wherein an error is thrown when I try opening an SQLite database after a chart s created.
Below is a sample method that crashes when called after a chart is created. It runs fine if there's no chart on the page yet.
public static void GetTrendData(string assetID, ObservableCollection<StringTrendline> trendData)
{
trendData.Clear();
using (SqliteConnection db = new SqliteConnection("Filename=" + AppDatabase))
{
SqliteDataReader query = null;
try
{
db.Open();
SqliteCommand selectCommand = new SqliteCommand("SELECT Result, MaintDate, TrendID FROM tbl_TestResult WHERE AssetID = '" + assetID + "'", db);
query = selectCommand.ExecuteReader();
}
catch (SqliteException error)
{
System.Console.WriteLine(error.Message);
System.Diagnostics.Debug.WriteLine(error.Message);
}
while (query.Read())
{
StringTrendline row = new StringTrendline()
{
AssetResult = query.GetString(0),
Timeline = query.GetString(1),
AssetTypeResult = "",
TrendID = query.GetString(2)
};
trendData.Add(row);
}
db.Close();
}
}