将数据从gridview文本框保存到sql server表 [英] Save data from gridview textbox to sql server table

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

问题描述

首先,我想要一个带有拖曳列 的网格视图,其中包含空白文本框,当用户填写这些文本框时,所有数据都应保存在sql server表中。和按钮应该在侧面或页脚。

firstly i want a gridview with tow columns having blank text box and when user fill those text boxes all data should save in sql server table. and button should be out side or in footer.

推荐答案

在按钮单击

in the button click
TextBox textname;
TextBox textname2;
   foreach (GridViewRow row in GridViewName.Rows)
        {
            textname= (TextBox)row.Cells[0].FindControl("TextBoxName");
            textname2 = (TextBox)row.Cells[1].FindControl("TextBoxName");
            // do here whatever you want :)
        }




(TextBox)row.Cells[0] 

type你在网格中进行的单元格数。

type the number of the cell here as you make it in the grid .


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

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