inserting data from datagridview to database

淺唱寂寞╮ 提交于 2019-12-04 19:06:47

I think you should approach the datagrid insert differently. check this out:

http://www.codeguru.com/csharp/.net/net_data/datagrid/article.php/c13041/Add-Edit-and-Delete-in-DataGridView.htm

I don't think allowing local work and then inserting all the new rows is the best approach here when the grid is able to let users insert new rows to the database when there is databound. the example does the database calls asynchronously to free the UI.

also I think you should at least use StringBuilder for your query; more manageable and I hope you are not really going to leave the connection string there like that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!