Dashes in uniqueidentifier

  • Are the dashes in the UniqueIdentifier always in the same index position?

    I have an Asp.Net mvc application where I pass a uniqueidentifer in the querystring as one of the parameters.  Normally this is not an issue to have the dashes in it.  However, In one solitary instance where I am creating a Pdf document, the Persits.PDF assembly will crash on the creation of HTML to PDF Conversion when there are dashes in the querystring.  If I remove the dashes from the Uniqueidentifier and pass it without dashes then it will convert the HTML file to Pdf for me. Leave them in there though and it will throw an error every time.

    My thought is to use the Replace function to remove them when I build the querysting, and then put them back in on the controller for this page before I pass to the SPROCS that I will be calling.

     

     

     

     

  • Yes.  The format is fixed, with the dashes always in the same locations.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Ni, it's not.

    even the order of parts may be different depending which application converts that binary(16) to a character string with dashes.

     

    _____________
    Code for TallyGenerator

  • https://docs.microsoft.com/en-us/dotnet/api/system.guid?view=net-5.0

    Check ToString method, the option with Format in it.

    you might find some formats not using dashes. The one with semicolons is quite popular.

    _____________
    Code for TallyGenerator

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply