Random rand = new Random(100); int ccc= rand.Next(000000000, 999999999);
protected void form1_Load(object sender, EventArgs e) { //Get the maximum ID from database int ID = //From Database. txtPostCode.Text=(ID + 1).ToString(); } protected void btnSave_CLick(object sender,EventArgs e) { // save button click // pass the text box value to database. }
using System.Security.Cryptography; // Import this Dll public string Get8Digits() { var bytes = new byte[4]; var rng = RandomNumberGenerator.Create(); rng.GetBytes(bytes); uint random = BitConverter.ToUInt32(bytes, 0) % 100000000; return String.Format("{0:D8}", random); }
DateTime.Now.ToString("MMddmmssff")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)