On rowupdating

Add(New Data Column("Col1_ML", Get Type(String))) dt.

Add(New Data Column("Col1_Others", Get Type(String))) dt. Read() '---For each row g_Temp Staff Key = "0" Temp Staff Key = reader("staff_key") 'will not null g_selectstaffkey = Temp Staff Key g_selectpostkey = reader("post_key") g_selectstaffname = RTrim(reader("name_eng")) g_selectpostcode = RTrim(reader("post_code")) Using conn3 As New System.

Add(New Data Column("Col1_Shift Type", Get Type(Int32))) dt. Add(New Data Column("Col1_Submitted By", Get Type(Int32))) Dim dr As Data Row While reader.

Connection = conn3 sql3 = "SET DATEFORMAT dmy; SELECT * FROM xxx" cmd3. New Row() dr("Staff Name") = g_selectstaffname dr("Post Code") = g_selectpostcode dr("Staff Key") = Temp Staff Key dr("Post Key") = Temp Post Key 'Col1 If Temp Shift Date = g_header1 Then dr("Col1_Roster Key") = Temp Roster Key dr("Col1_Shift Date") = Temp Shift Date dr("Col1_Start Time") = Temp Start Time dr("Col1_End Time") = Temp End Time dr("Col1_SL") = Temp SL dr("Col1_VL") = Temp VL dr("Col1_ML") = Temp ML dr("Col1_PH") = Temp PH dr("Col1_APH") = Temp APH dr("Col1_TOIL") = Temp TOIL dr("Col1_Others") = Temp Others dr("Col1_Shift Type") = Temp Shift Type dr("Col1_Submitted By") = Temp Submitted By End If End If .................

In my + VB Gridview, I had bind several column from datatable into one single column of the gridview. The following is the VB code: Protected Sub Grid View1_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) 'Set the edit index. Bind Data() End Sub Protected Sub Grid View1_Row Canceling Edit(By Val sender As Object, By Val e As Grid View Cancel Edit Event Args) 'Reset the edit index. Edit Index = -1 'Bind data to the Grid View control.

But I have no idea how to get those value when doing Row Editing & Row Updating. Bind Data() End Sub Protected Sub Grid View1_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) 'Retrieve the table from the session object.

New Edit Index 'Bind data to the Grid View control. Bind Data() End Sub Private Sub Create Data Table() Dim cmd As New System. Dim dt = CType(Session("dt"), Data Table) 'Update the values. Edit Index = -1 'Bind data to the Grid View control. Sql Command Dim sql As String Dim reader As System. Sql Command Dim sql3 As String Dim reader3 As System. Connection = conn2 sql = "SET DATEFORMAT dmy; SELECT * FROM XXXX " cmd. Execute Reader() Dim Temp Staff Key As Integer Dim Temp Post Key As Integer Dim Temp Shift Date As Date Time Dim Temp Start Time As Date Time Dim Temp End Time As Date Time Dim Temp SL As String Dim Temp Roster Key As Integer Dim Temp VL As String Dim Temp ML As String Dim Temp PH As String Dim Temp APH As String Dim Temp TOIL As String Dim Temp Others As String Dim Temp Shift Type As Integer Dim Temp Submitted By As Integer Dim dt As New Data Table() dt. Add(New Data Column("Staff Name", Get Type(String))) dt. Add(New Data Column("Post Code", Get Type(String))) dt. Add(New Data Column("Staff Key", Get Type(Int32))) dt. Add(New Data Column("Post Key", Get Type(Int32))) 'Monday dt. Add(New Data Column("Col1_Roster Key", Get Type(Int32))) dt. Add(New Data Column("Col1_Shift Date", Get Type(Date Time))) dt. Add(New Data Column("Col1_Start Time", Get Type(Date Time))) dt. Add(New Data Column("Col1_End Time", Get Type(Date Time))) dt. Add(New Data Column("Col1_SL", Get Type(String))) dt. Add(New Data Column("Col1_VL", Get Type(String))) dt.

Tags: , ,