Catch Row validating exceptions

G

Guest

I am using a typed dataset and would like to perform some validations on a
row before it is edited or added to a datatable. I have tried putting
validation in the RowUpdating event (using SetColumnError) however this
doesn't block the row from being added. If I throw an exception this does
block the add, but I can't see to find how to catch the exception because it
throws the exception outside of the addrow inline code. ANy help?

I can't do this because the exception will get thrown in an event outside
the calling method.

Try
AddRowtoTable()

Catch Ex As Exception
'failed to add row because of validation issue
End Try
 
C

Cor Ligthert [MVP]

KB,

Why not go trough it in a for index loop, if you cannot find a field, than
know that a STD inherits a normal Dataset.

Cor
 

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