B
Bob of the West
Hi all,
Anyone have this book? I've run into an example that doesn't work, and
can't relax until I understand what's wrong!
Listing 1.4, p45 ( see below )
In the book it says 'If e.Row.Item "FirstName") = "" 'etc.
But the downloadable code says 'If e.Row.Item("FirstName").length = 0
Neither seem to work. I get "An unhandled exception of type
'System.Data.DeletedRowInaccessibleException' occurred in
system.data.dll Additional information: Deleted row information cannot
be accessed through the row."
Anyone already figured it out? There's no 'errata' section on the
publishers web site ( though you can download the source code )
Best wishes,
P
This is the subroutine:
Private Sub SqlDataAdapter1_RowUpdating(ByVal sender As Object, ByVal
e As System.Data.SqlClient.SqlRowUpdatingEventArgs) _
Handles SqlDataAdapter1.RowUpdating
'this line is in the ownload code
'If e.Row.Item("FirstName") = "" Or e.Row.Item("LastName") =
"" Then
'this line is in the book
If e.Row.Item("FirstName").length = 0 Or
e.Row.Item("LastName").length = 0 Then
MsgBox("Changes not Saved;Customer must have a first and
last name.")
e.Status = UpdateStatus.SkipCurrentRow
e.Row.RejectChanges()
End If
End Sub
Anyone have this book? I've run into an example that doesn't work, and
can't relax until I understand what's wrong!
Listing 1.4, p45 ( see below )
In the book it says 'If e.Row.Item "FirstName") = "" 'etc.
But the downloadable code says 'If e.Row.Item("FirstName").length = 0
Neither seem to work. I get "An unhandled exception of type
'System.Data.DeletedRowInaccessibleException' occurred in
system.data.dll Additional information: Deleted row information cannot
be accessed through the row."
Anyone already figured it out? There's no 'errata' section on the
publishers web site ( though you can download the source code )
Best wishes,
P
This is the subroutine:
Private Sub SqlDataAdapter1_RowUpdating(ByVal sender As Object, ByVal
e As System.Data.SqlClient.SqlRowUpdatingEventArgs) _
Handles SqlDataAdapter1.RowUpdating
'this line is in the ownload code
'If e.Row.Item("FirstName") = "" Or e.Row.Item("LastName") =
"" Then
'this line is in the book
If e.Row.Item("FirstName").length = 0 Or
e.Row.Item("LastName").length = 0 Then
MsgBox("Changes not Saved;Customer must have a first and
last name.")
e.Status = UpdateStatus.SkipCurrentRow
e.Row.RejectChanges()
End If
End Sub