如何将数据插入到GridView中然后再插入数据库中 [英] How to insert data in GridView and then into database

查看:64
本文介绍了如何将数据插入到GridView中然后再插入数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用动态gridview ...
我想将数据插入到gridview中并发送到数据库....





有人可以帮我,怎么做.

i am using dynamical gridview...
i want to insert data in gridview and to databasa....





can somebody please help me ,how to do this.

推荐答案

我想您需要从ADO.NET开始

看看这个链接.

http://msdn.microsoft.com/en-us/library/aa302325.aspx [ ^ ]

这肯定会对您有帮助.

问候,
Eduard
I guess you need to start with ADO.NET

Take a look at this link.

http://msdn.microsoft.com/en-us/library/aa302325.aspx[^]

That will surely help you.

Regards,
Eduard


您可以逐行读取数据,并尝试将其添加到sqlCommand插入命令的参数中,然后尝试执行命令.
您可以使用dataadapter连接到数据库,然后可以将数据填充到数据集中,然后将新数据添加到数据集中.然后尝试使用yourdataadapter.update().
参考链接:将数据从Gridview中拉出并插入到数据库 [ ^ ]
you can read data row by row and try to add them in parameter of your sqlCommand Insert command and then try to execute your command.
you can use a dataadapter to connect to your database and then can fill data to dataset and then add new data your dataset. then after that try simply use yourdataadapter.update().
Reference link:- Pulling Data from Gridview and Insert to Database[^]


这篇关于如何将数据插入到GridView中然后再插入数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆