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

  • Thread starter francesco.fantoni
  • Start date
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
 
F

Francesco Fantoni

im very surprised anyone have got into this problem..
Nobody validates data in this event?
if not ,where does you attempt to validate data?

thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top