gridview未绑定到数据库

编程入门 行业动态 更新时间:2024-10-25 04:20:51
本文介绍了gridview未绑定到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

海, 我想保留gridview详细信息.当我单击恢复"按钮时,网页应该 允许在同一发票编号中输入更多详细信息. 注意:gridview未绑定到数据库. 任何想法.

Hai, I want to hold the gridview details.when i click resume button the web page should allow to enter further details in same invoice number. note : gridview is not bind to database . any ideas.

推荐答案

Get the grid view count then implement the below code protected void GridView1_RowCommand (object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { string strFirstName = ((TextBox) GridView1.FooterRow.FindControl("txtFname")).Text; string strLastName = ((TextBox)GridView1.FooterRow.FindControl ("txtLname")).Text; string strDepartment = ((TextBox)GridView1.FooterRow.FindControl ("txtDept")).Text; string strLocation = ((TextBox)GridView1.FooterRow. FindControl("txtLoc")).Text; SqlDataSource1.InsertParameters["fieldname"].DefaultValue = strFirstName; SqlDataSource1.InsertParameters["fieldname"].DefaultValue = strLastName; SqlDataSource1.InsertParameters["fieldname"].DefaultValue = strDepartment; SqlDataSource1.InsertParameters["fieldname"].DefaultValue = strLocation;<b></b> SqlDataSource1.Insert(); } }

更多推荐

gridview未绑定到数据库

本文发布于:2023-10-16 00:36:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1495955.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   数据库   gridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!