Reputation: 9570
I have this code , which is supposed to check if value is nothing
_Attendee.TransactionID = If((a.tGatewayTrxID Is Nothing), Guid.NewGuid(), a.tGatewayTrxID.ToString)
The last part of this code is throwing exception "Conversion from type 'Guid' to type 'String' is not valid." I know that IIF
evaluates each part of the statement, If
is not supposed to do that. I use this same code all over the place and it always catches null or Nothing values - why is it not working in this case?
Upvotes: 2
Views: 4905
Reputation: 3794
If TransactionID is a string I believe you just need to change Guid.NewGuid() to Guid.NewGuid().ToString().
Upvotes: 4