Hello team,
using Xamarin forms XAML with C# code
I need the best method to store the data in SQL lite. Please find the below table structure.
Table:
public class tblItemList
{
[Collation("NOCASE")]
public string parent { get; set; }
[Collation("NOCASE")]
public string child { get; set; }
}
I need to store above 1 lack records, and I have a record list in the table class. Currently, I have for loop storing the table data. It is taking more time to save.
code:
List itemlist = JsonConvert.DeserializeObject>(DecryptString(result));
foreach (tblItemList item in itemlist)
{
var ddd = await App.Database.SaveItemAsync(item);
}
Table creating method:
public DBworker(string dbPath)
{
database = new SQLiteAsyncConnection(dbPath);
database.CreateTableAsync().Wait();
}
Inserting method:
public Task SaveItemAsync(tblItemList itemList)
{
// Save a new note.
return database.InsertAsync(itemList);
}
In saving above 1 lack records, it will take 30 min’s, so I need to store in quick method, please suggest any best method for storing data in SQL lite db.

Mario ScheerenPosted Jul 15, 2021, 9:29 AM