C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




What is GUID ? How to generate a GUID ?


Posted Date: 11 Mar 2004    Resource Type: Articles    Category: General
Author: Tony JohnMember Level: Gold    
Rating: Points: 10



GUID stands for Globally Unique IDentifier. It is a string of
numbers and/or letters.


A GUID represents a Unique identifier - means you cannot generate the same GUID
more than once. A GUID has a very low (...practically impossible) probability of being duplicated


GUIDs have a variety of applications. You can use a GUID as a primary
key in your database table or in a several other scenarios. A good
example would be, if you have a distributed application where data is
generated and stored in various locations and you want to merge all those
data at some intervals of time, you may use GUID as the primary key.

GUIDs can be generated in a number of ways; most often a hash of
several things that might be unique at any given point in time like the IP
address plus the clock date/time etc are used to generate Unique Ids.
Each system may have slightly different algorithm to generate the Unique
Id.

In .net, you can use the System.Guid class to generate a GUID. See the
following sample code :

System.Guid guid = System.Guid.NewGuid ();
String id = guid.ToString();

System.Guid.NewGuid () returns a Guid object. You can use the
.ToString() method to convert it to a string. In the above example, you may get
a string which look like the following:

"b91c9121-0a17-4b26-a09d-d5980eb532db"


Can anyone generate the same Guid as shown above ? Try your luck !!




Responses

Author: Abhinav    18 Sep 2004Member Level: Bronze   Points : 0
It helped me a lot. i got an idea abt how to avoid multiple savings


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: AutoPostBack - What it is and How it works ?
Previous Resource: How to convert C# code to Vb.net
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use