F
francesco.fantoni
if i throw an exception in datatable rowchanging (using strongly typed
dataset) this exception don't propagate in debug mode (at runtime it
seems work instead)
in details, im using vs2005 with sqlserver 2005 express and i have a
strongly typed dataset with customer datatable and a form with
bindingnavigator. In CustomersBindingSaveitem_Click event :
Try
Me.Validate()
Me.CustomersBindingSource.EndEdit()
Me.CustomersTableAdapter.Update(Me.DataSet.Clienti)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information,
My.Application.Info.Title)
End Try
RowChanging handler is this:
Private Sub CustomersDataTable_CustomersRowChanging(ByVal sender As
System.Object, ByVal e As ClientiRowChangeEvent) Handles
Me.CustomersRowChanging
If .... Then
e.Row.SetColumnError("customer", "customer is
invalid")
e.Row.RowError = "customer is invalid"
Throw New ArgumentException(e.Row.RowError)
Else
e.Row.SetColumnError("customer", ", "")
e.Row.ClearErrors()
End If
End Sub
i need to cancel row updating and according with msdn i have to throw
an exception in Rowchanging event.
I have found this passed issue:
http://groups.google.it/group/micro...ging+exception&rnum=16&hl=it#4d8baec0dfe6636e
it's a bug also in ado.net version 2.0?
Thanks,
- Francesco
dataset) this exception don't propagate in debug mode (at runtime it
seems work instead)
in details, im using vs2005 with sqlserver 2005 express and i have a
strongly typed dataset with customer datatable and a form with
bindingnavigator. In CustomersBindingSaveitem_Click event :
Try
Me.Validate()
Me.CustomersBindingSource.EndEdit()
Me.CustomersTableAdapter.Update(Me.DataSet.Clienti)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information,
My.Application.Info.Title)
End Try
RowChanging handler is this:
Private Sub CustomersDataTable_CustomersRowChanging(ByVal sender As
System.Object, ByVal e As ClientiRowChangeEvent) Handles
Me.CustomersRowChanging
If .... Then
e.Row.SetColumnError("customer", "customer is
invalid")
e.Row.RowError = "customer is invalid"
Throw New ArgumentException(e.Row.RowError)
Else
e.Row.SetColumnError("customer", ", "")
e.Row.ClearErrors()
End If
End Sub
i need to cancel row updating and according with msdn i have to throw
an exception in Rowchanging event.
I have found this passed issue:
http://groups.google.it/group/micro...ging+exception&rnum=16&hl=it#4d8baec0dfe6636e
it's a bug also in ado.net version 2.0?
Thanks,
- Francesco