将Gridview内容导出到SQL数据库 [英] Export Gridview contents to SQL database

查看:78
本文介绍了将Gridview内容导出到SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从SQL查询填充的gridview.我现在想使用gridview中的数据在另一个数据库中创建一个新表.我是否必须从gridview中提取每一行并一次更新一行新数据库?可以一次完成吗?任何建议将不胜感激.

I have a gridview that was populated from a SQL Query. I now want to create a new table in another database using the data in the gridview. Do I have to extract each row from the gridview and update the new data base one row at a time? Can this be done all at once? Any suggestions would be appreciated.

推荐答案

是的,ASP.NET支持批量更新.一种方法是将数据作为xml传递.还有另一种使用SQLDataSource的方法,但在实际情况下用处不大.
以下链接介绍了几种方法-
使用Gridview和Sql进行批量更新服务器XML [ ^ ]
http://msdn.microsoft.com/en-us/library/aa992036.aspx [ ^ ]
在CodeProject上有一篇文章,它通过扩展GridView以直接向其中添加批量更新功能而付出了更多努力.它在这里-使用不带xxxDataSource(SqlDataSource,ObjectDataSource等)的GridView进行批量编辑 [ ^ ]

希望这会有所帮助!
Yes, bulk update is supported in ASP.NET. One of the ways is to pass the data as xml. There is another method using SQLDataSource but that is not of much use in practical scenarios.
Below links which describes few methods -
Bulk Update using Gridview and Sql Server XML [^]
http://msdn.microsoft.com/en-us/library/aa992036.aspx[^]
There is an article on CodeProject which goes an extra mile by extending the GridView to add bulk update feature directly to it. And it''s here - Bulk Edit with GridView without xxxDataSource (SqlDataSource, ObjectDataSource, etc.)[^]

Hope this helps!


这篇关于将Gridview内容导出到SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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