简体   繁体   English

c# 控制台应用程序.netcore 3.0 sqlite-net-pcl | 无法添加行

[英]c# console application .netcore 3.0 sqlite-net-pcl | Unable to add rows

I am using: c# console application .netcore 3.0 sqlite-net-pcl and I am unable to add rows to a table from consecutive insert operations.我正在使用:c# 控制台应用程序 .netcore 3.0 sqlite-net-pcl,我无法通过连续插入操作将行添加到表中。 If I step through a debug, the table will populate partially.如果我单步调试,该表将部分填充。

foreach (Trivia t in trivias){triviaDBHardKey.HardKeyTrivia(t);}

public async void HardKeyTrivia(Trivia trivia
    {awaitProgram.Database.SaveTriviaAsync(trivia));}

The sqlite-net-pcl SaveTriviaAsync command works with Xamarin, so I assume it is not useful for c#-app-console. sqlite-net-pcl SaveTriviaAsync 命令适用于 Xamarin,所以我认为它对 c#-app-console 没有用。 My issue now is how to clear the database and re-populate it and once re-populated;我现在的问题是如何清除数据库并重新填充它,一旦重新填充; view it on a list view.在列表视图中查看它。 I am able to delete it and re-populate it on two emulation starts, however, how to do this with one session is beyond me.我可以在两次仿真启动时删除它并重新填充它,但是,如何用一个 session 执行此操作超出了我的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM