且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在异步页面中一个接一个地插入多个记录

更新时间:2023-02-01 20:47:50

在这种情况下,我将使用AJAX.带外插入数据库将异步完成,您可以在不刷新页面的情况下向客户端提供更新的状态.

如果需要代码,可以使用大量的AJAX示例.
For this scenario I would use AJAX. Being out of band the database inserts would be done asynchronously and you could provide updated status to the client without refreshing the page.

If you want code, there are a plethora of AJAX examples available.


您可以填充列表并使用foreach插入数据库中,还可以使用try catch来处理错误! /> 例如,在catch中,您可以从头开始填充,我们可以中断该过程.
you can populate a list and use foreach to insert in database, and you can use try catch to handle errors!
for example in catch you can start populating from the start, our you can break the process.