Made a method (in class):
public static async Task LoadBase() { StringBuilder sb = new StringBuilder(); using (SQLiteConnection con = new SQLiteConnection(string.Format("Data Source={0};", CommonData.pathBase))) { await con.OpenAsync(); DataSet dt = new DataSet(); using (SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM `base`", con)) { using (SQLiteDataAdapter da = new SQLiteDataAdapter(cmd)) { da.Fill(dt); sb.Append(dt); } } } } I created a StringBuilder and now I want to add all the data to it in order to display it later in the DataGridView . The problem, in fact, is how to add all the rows somewhere to put them in the DataGridView later in the form?
StringBuilder? - Ev_HyperFunc.LoadBase();writes a Warning: since this call is not expected, the current method continues until the end of the call. Try applying the await operator to the result of the call. I did soTask.Run(async () => await Func.LoadBase());the warning is gone, but the data is no longer loading .. - Maxim