如何在gridview中出现的文本框中将值插入到数据库中 [英] how to insert value in a text box which is present on gridview into database

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

问题描述

实际上我使用一个gridview来显示费用详情,因为它会显示所有费用类型,金额,支付金额。我们输入金额的每一行的网格视图中都会出现一个文本框,如果点击它,我会在提交按钮的底部显示一个文本框,应将输入金额的费用详细信息插入表格中。大致下面我将展示我的gridview演示



Actually i am using one gridview for displaying fee details in that it will display all the fee types,amount,amount to pay. and one text box will be present on the gridview of every row in that we have enter the amount and at the bottom i am having submit button if i click it should insert the fee details with entered amount into the table. below roughly i will show my gridview presentation

Fee_type     |amount  |paid_amount| amount_to_pay  | textbox
reg_fee      |1000    |  500      |   500          |  400
admission_fee|2000    |  1000     |   1000         |  5000
tutuion_fee  |2000    |  900      |   1100         |
transport_fee|1000    |  800      |   200          |  100





认为与上述设计一样,我将在gridview中显示详细信息在文本框列下我将输入我将点击提交按钮的金额我应该插入详细信息。这里我的问题是我应该根据费用保存应该保存的金额。在哪个gridview事件文本框事件将触发...



think that like above design i will display details in a gridview under textbox column i will enter the amount i will click on submit button i should insert the details. here my problem is i should save according to the fee the amount should be saved .in which gridview event the text box event will fire...

推荐答案

在Html中来源使用Eval方法。例如=
In the Html Source use "Eval" Method. Eg =
<asp.textbox id="txt1" text="<%#Eval("id")%>"></asp.textbox>


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

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