Exception add additional data

Hi, I am trying to add additional data to an exception.

I’ve been looking at this website but cant get it to work when I try to assign it to an exception

I have tried ex.Data.Add(“ErrorInfo”,str_erDet)
and also tried ex[“ExtraInfo”] = str_erDet

but both give error messages (shown below)

any help would be appreciated.

Thanks,
Peter

Hi,

You can use “( )” in VB.net, instead of “[,]” as follows:

img20190814-1

Regards,

Yoichi

Great it works now, thanks for that!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.