将动态创建的gridview数据插入数据库 [英] insert dynamically created gridview data into database

查看:128
本文介绍了将动态创建的gridview数据插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想将动态创建的gridview数据插入数据库.

请帮助我的朋友.

Hi,

I want to insert a dynamically created gridview data into database.

Please help me friends.

推荐答案

你好,

取空​​白行并将其绑定为数据源.这样,您将在网格后缀中获得一个空白行,可以向其中添加数据.但是是的,您需要了解视图状态.


希望它对您有帮助..如果您需要进一步的帮助,请发表正确的评论

谢谢

sanjeev
Hello,

take a blank row and bind the row as datasource. by this you will get the one blank row in grid afterwords you can add data to them. but yes for this you need have knowledge of view state.


hoping it will help you.. right comments if you need any furthur help

thanks

sanjeev


动态创建的事实意味着,除非在page_load之前插入它,否则您将无法找到它的数据,否则,它的viewstate为丢失.一旦获取了数据,就可以像插入其他数据一样将其插入.
The fact it''s dynamically created means you won''t be able to find it''s data unless you insert it before page_load, otherwise, it''s viewstate is lost. Once you can get it''s data, you insert it like any other.


您好,

现在,您知道了Gridview及其相应的行.单击按钮,并在单击事件上初始化数据库连接.使用循环创建一个字符串,该字符串具有来自网格的插入数据,并最终执行该命令.

它将数据插入相应的DB.

例如,指向google,了解如何将数据从gridview插入数据库.它会给您很多链接.

谢谢
Sanjeev
Hello,

Now you know your Gridview and their respective rows right. take a button and on click event initialilze the connection for DB. Using a loop create a string that has insertion data from grid and finaly execute that command.

it will insert the data into respecetive DB.

for example point google for How to insert data from gridview to DB. it will give you lots of link.

thanks
Sanjeev


这篇关于将动态创建的gridview数据插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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