Datagrid保存到数据表 [英] Datagrid save to a datatable

查看:136
本文介绍了Datagrid保存到数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何只需单击一次保存按钮,一次就将所有datagrid行保存在sql server 2005数据表中

how to save all datagrid rows in an sql server 2005 datatable in just a click of a save button, all same time

推荐答案

编写保存的处理程序按钮.在处理程序中迭代DataGrid,如果已存储proc调用它,否则创建动态SQL Insert语句并使用SQLCommand Object触发该语句.

简单....
Write a handler of the Save button. In the handler iterate the DataGrid, and if you have stored proc call it, otherwise create dynamic SQL Insert statement and fire the same with SQLCommand Object.

Simple....


这篇关于Datagrid保存到数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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