Rowchanging exception don't propagate (ado.net 2)



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/microsoft.public.dotnet.framework.adonet/browse_thread/thread/8c4a1f751694d971/4d8baec0dfe6636e?lnk=st&q=rowchanging+exception&rnum=16&hl=it#4d8baec0dfe6636e

it's a bug also in ado.net version 2.0?

Thanks,
- Francesco

.



Relevant Pages

  • Re: Changing a row during the RowChanging/RowChanged event
    ... I'm not sure why you would want to do this since your RowState should ... exception with your task, since it would endlessly fire itself. ... > modified during the RowChanging or event of the DataTable ... > value in the RowChanging event. ...
    (microsoft.public.dotnet.framework.adonet)
  • RowChanging - stop moving from current row
    ... There is a way to stop moving from current row in data table RowChanging ... Throwing an exception not work as I want. ... Dan ...
    (microsoft.public.dotnet.framework.adonet)
  • Changing a row during the RowChanging/RowChanged event
    ... Does anybody know how can I make changes to the DataRow that is being ... modified during the RowChanging or event of the DataTable ... protected void RowChanging(object sender, System.Data.DataRowChangeEventArgs ... The code above throws an exception. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Some questions about handling exceptions and when to throw them
    ... In the event that a customer can't be ... Possibly even my own exception, ... because the caller should have checked first. ... If GetEmployeeInfo fails, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: get variable that involve with exception
    ... debug profile and deliver to customer for debugging session. ... know about the code version problem), and add the CLI code thet make ... there no problam to add to exception viewer the source ...
    (microsoft.public.dotnet.framework)

Loading