Quote:
Im totally new to coding im learning as i go along but this the part im stuck on and not sure how to go about it
But, you know how to do one, and you know - I assume - what a loop is.
You know how to get the content from a TextBox, and you know - I assume - how to convert that to an integer.
Combining those things is not a complex process!
But ... this is a bad idea, because SQL Server is a multiuser environment, which means that "preallocation" of data is a bad idea. Why? Because if two users decide to allocate the same or overlapping ranges everything gets messed up together and you get major problems - like the same serial number being issued to two objects.
Now, you may say "that won't happen" - but you have no idea what the code will be used for next week, next moth, next year - and if you do get multiple users entering data (and you will), then at some point it will happen - and then it becomes a real PITA to sort out, because the database no longer reflects reality and you have no idea what is going on. And these things are only ever noticed when it's too late to stop things and apply a "quick fix" ensuring your data integrity.
Look at what you are doing, and think about usage: it's almost certain that you need either a much better scheme than this, or you need a much better way to sort out which numbers have been allocated that a simple "block of twenty" approach.