pgilfeather
asked on
Problems with code while performing updatecommand from datagrid with strongly typed dataset
I have the following datagrid
VideoDetailID Edit Column VideoTitle VideoDuration VideoURL GlobalAccessID
1 Edit MyTitle 2.46 C:/...... 25
2 Edit MyTitle2 3.56 C:/...... 32
I have used a strongly typed dataset and am trying to implement the update command.
The following is my code for the updatecommand
Private Sub dgTypedDataGrid_UpdateComm
BindToGrid()
'Dim the values you are working with
Dim VideoTitle As String
Dim VideoDuration As Decimal
Dim VideoUrl As String
Dim GlobalAccessID As String
Dim dt As DataTable
Dim dr As DataRow
Dim txt As TextBox
'Retrieve the changed data
txt = CType(e.Item.Controls(2).C
VideoTitle = CType(txt.Text, String)
txt = CType(e.Item.Controls(3).C
VideoDuration = CType(txt.Text, Decimal)
txt = CType(e.Item.Controls(4).C
VideoUrl = CType(txt.Text, String)
txt = CType(e.Item.Controls(5).C
GlobalAccessID = CType(txt.Text, Integer)
'Retrieve stored data
Dim VideoCache As DataSet = CType(Cache.Get("VideoCach
dt = VideoCache.Tables("tblVide
dr = dt.Rows.Find(CStr(e.Item.C
If Not (dr Is Nothing) Then
With dr
.Item("VideoTitle") = VideoTitle
.Item("VideoDuration") = VideoTitle
.Item("VideoUrl") = VideoTitle
.Item("GlobalAccessID") = VideoTitle
End With
End If
daVideoDetails.Update(dt)
'Restore the grid to read only
dgTypedDataGrid.EditItemIn
BindToGrid()
End Sub
The above code keeps stopping at dr = dt.Rows.Find(CStr(e.Item.C
To be honest I dont know what "dr = dt.Rows.Find(CStr(e.Item.C
I hope all this makes sense.
Cheers
Paul G
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.