Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. How to give a unique id like that 15b85c2b-83ca-44ec-8741-22a4dc64f64d in using c#

How to give a unique id like that 15b85c2b-83ca-44ec-8741-22a4dc64f64d in using c#

Scheduled Pinned Locked Moved XML / XSL
tutorialcsharpdatabasecomxml
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vishnu Narayan Mishra
    wrote on last edited by
    #1

    I have a little query of generting unique id for creating node , Is there is any way to generate random no ... I have to genarate a random no for FieldUniqueId attribute in the each time when I create a new node .. I tried it by using Session.SessionID but the no string genarated for example 'hzskur45zxzh4jiwq5lsp3j3' this is same during for the logged user .... also i have to generate random no string in the format like '15b85c2b-83ca-44ec-8741-22a4dc64f64d' .. following is the strucuture of XML file Blank Blank NewField1 15b85c2b-83ca-44ec-8741-22a4dc64f64d http://careers.msn.com/ Careers & Jobs <A href="http://careers.msn.com">Careers & Jobs</A> ...... ......

    V 1 Reply Last reply
    0
    • V Vishnu Narayan Mishra

      I have a little query of generting unique id for creating node , Is there is any way to generate random no ... I have to genarate a random no for FieldUniqueId attribute in the each time when I create a new node .. I tried it by using Session.SessionID but the no string genarated for example 'hzskur45zxzh4jiwq5lsp3j3' this is same during for the logged user .... also i have to generate random no string in the format like '15b85c2b-83ca-44ec-8741-22a4dc64f64d' .. following is the strucuture of XML file Blank Blank NewField1 15b85c2b-83ca-44ec-8741-22a4dc64f64d http://careers.msn.com/ Careers & Jobs <A href="http://careers.msn.com">Careers & Jobs</A> ...... ......

      V Offline
      V Offline
      Vishnu Narayan Mishra
      wrote on last edited by
      #2

      I got the answer..there is a method in System namespace called Guid(). we can use it as string newID = Guid.NewGuid().ToString(); its genarate every time a uniue Id according to my requirement.. Thanks

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups