Onrowupdating vb gridview

Rated 3.80/5 based on 840 customer reviews

Query String("student ID") Dim str Subject Code As String = Request.

Text = str Section Dim str Table Name As String = LBSubject Code. Text Dim conn String As String = Configuration Manager. Connection String Using my Conn As New Sql Connection(conn String) my Conn.

Hello Senthil, To display the grid column editors inline when the grid switches into edit mode, change the table view's Edit Mode property to "In Place".

This is demonstrated here: Automatic Operations And use Grid Dropd Down Column in order to show Drop Down List control when editing the grid.

Make one function that will fetch data from database and and return Data Set/Data Table like, gv. Add(New Sql Parameter("@Subject Code", LBSubject Code.

Text Dim Status As String = Direct Cast(GV_Student Record. Thank you so much for being interested and helping me out. gurubhullar Hi, By looking into your code, Grid will bind on each postback so your code in Row Editing and Row Deleting will not get effect.

Message) End Try End Using End Sub Protected Sub GV_Student Record_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) GV_Student Record.

Data Bind() End Sub Protected Sub GV_Student Record_Row Canceling Edit(By Val sender As Object, By Val e As Grid View Cancel Edit Event Args) GV_Student Record. Data Bind() End Sub Protected Sub GV_Student Record_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) Dim Taken Date As String = Direct Cast(GV_Student Record. Query String("subjectcode") Dim str Section As String = Request.

Redirect("~/Login Page.aspx") End Sub Private Sub Update Record(By Val Taken Date As String, By Val Status As String) Dim str Table Name As String = LBSubject Code. Text Dim conn String As String = Configuration Manager. Connection String Dim my Conn As New Sql Connection(conn String) Dim sql Statement As String = "UPDATE " & str Table Name & " SET Taken Date = @Taken Date, Status = @Status" Try my Conn.

Sql Exception Dim msg As String = "Insert/Update Error:" msg = ex. Close() End Try End Sub Protected Sub Page_Load(By Val sender As Object, By Val e As System. Query String("subjectcode") Dim str Section As String = Request.

Leave a Reply