Link to home
Start Free TrialLog in
Avatar of CarlaGibson
CarlaGibsonFlag for United States of America

asked on

Option Strict On disallows implicit conversions from 'Object' to 'System.Guid'

I'm getting the following error:

Option Strict On disallows implicit conversions from 'Object' to 'System.Guid'


Here's my code:


Dim prmOutputParam As SqlParameter = cm.Parameters.Add("@UserKeyGUID", SqlDbType.UniqueIdentifier)
prmOutputParam.Direction = ParameterDirection.Output


Dim tmpGUID As Guid
tmpGUID = cm.Parameters("@UserKeyGUID").Value


What is the proper way to tell .NET that cm.Parameters("@UserKeyGUID").Value is a Guid and not an Object?

ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CarlaGibson

ASKER

Perfect!  I knew it was something easy!!  Thanks!
Thanks!
Not a problem, glad I was able to help.  ;=)