且构网

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

如何从gridview插入多个行到数据库?

更新时间:2023-10-22 14:49:58

问题似乎是您确实没有在任何地方插入new Item .您正在调用it.insert(),但调用中没有任何新项目的构造函数来指示有什么地方可以插入新对象!

也许这没有帮助,但是您可能对所编码的内容不完整.
The problem seems to be that you are really not inserting the new Item anywhere. You are calling the it.insert() but there is nothing in the call for the constructor of new item to indicate that there is somewhere to insert the new object!!

Maybe this is not helpful, but you may have an incomplete explanation of what you are coding.


您好,sara,

我认为将多行插入数据库是一种不好的做法.

您应该尝试创建XML字符串,并将逻辑放入数据库端存储过程中并插入记录.

这也将减少连接数据库的往返行程.

Thnx ....
Hi sara,

I think this is bad practice to insert multiple row into database.

You should try to create XML string and put your logic in Database side stored procedure and insert record.

This will also decrease your round trip for connecting database.

Thnx....