Is there any built-in method in asp.net to convert a string to a uniqueidentifier for SQL Server, just like .ToString().
I get an error: Conversion failed when converting from a character string to uniqueidentifier.
Or does anyone have an idea how to do solve this problem. Thanks.
There’s a constructor for
Guidwhich takes astringas a parameter.Make sure it’s in the correct format:
Full documentation can be found here.
You can pass your RoleID guid in as a parameter: