You can use a text file to generate and store the number.
using System.IO;
private int GenerateSequenceNumber()
{
string file2 = "test.txt";
FileInfo fiRead = new FileInfo(file2);
string input = string.Empty;
int num = 1;
if (fiRead.Exists)
{
input = File.ReadAllText(file2);
}
if (input != string.Empty)
{
num = Convert.ToInt32(input);
}
File.WriteAllText(file2, (num + 1).ToString());
return num;
}