Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a requriment to create autogenerated key when data is inserted to database and also insert that generated key for that data

Ex: If i enter any data to database through Textbox
in background a encriped key will generat for that data in databse
if i enter another data to database one more key will generat and save to that data

DataBase:
C#
Column1    | Column2     | Column3
Topic(1)   |TpoicInfo(1) | AutoKeyGenereted(1)
Topic (2)  |TpoicInfo(2) | AutoKeyGenereted1(2)



Example
C#
Topics   | TpoicInfos | AutoKeyGenereteds
Picnic   | Good       | 456789523565fdf
Movie    | Bad        | 9652332fdfdf222

like that i want
Posted
Updated 30-Apr-14 23:34pm
v2
Comments
Vedat Ozan Oner 1-May-14 5:09am    
see here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5%28v=vs.110%29.aspx

1 solution

You can make use of
C#
Guid.NewGuid().ToString()
Also see this : How Random is System.Guid.NewGuid()?[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900