Hi,
the links provided to me in microsoft doesn't help me much,,
can any one pls let me know , why to use GUID in .NET framework, how does it work and what is the necessity of declaring GUID.
Thanks,,
GUIDs are used in applications that transfer data between different system and/or databases. In this situation it is impractical to determine whether a particular ID exists in any of the connected systems. You should only use GUIDs in this type of situation.
The GUID itself is, essentially, a very large hexadecimal number, which is randomly generated. That fact that it is so large means that it is extremely unlikely that it would be duplicating an existing ID.
chandras17 wrote:
can any one pls let me know , why to use GUID in .NET framework, how does it work and what is the necessity of declaring GUID.
I had to use it in a former intranet application because I had to deal with Documentum. Also, sites that offer protected content tend to use guids because you can't really guess the next article (if it would be just like ...?articleid=13 then you could guess the next article would be 14).
On the other hand I heard one of our database specialists say that he discourages using guids as a primary key because they take up too much place. Just a thought.
Grz, Kris.
A GUID is just what it sounds like. A unique identifier that's globallyunque. Thus, if you need some type of unique identifier (say, a primarykey in a database) that must be unique not only locally (that table)but globally (across virtually time and space), you use a GUID. Thatway you dont run into problems such as combining two tables withprimary keys being integer identify fields. Each table will have a PKof 1,2,3, etc. Not so with GUIDs.
GUIDs also work for creating single-use keys. Say a credit card companywants to create single-use credit card numbers for card holders to useon the internet. The card user goes to their site, generates a GUID,and uses that to buy something. When the retailer submits the GUID tothe credit card company, the CC company validates the GUID back to thecardholder's account and then marks the GUID as "used" so it can neverbe used again -- thus prevening fraud.
0 comments:
Post a Comment