本文介绍了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未绑定到数据库
发布评论