Well, it's easy enough to just do something like:
var rand = new Random();
var uid = rand.Next(100000, 1000000);
However, the only way to ensure uniqueness in the database would be to 1) query to ensure the value doesn't exist first (though there's concurrency issues there) or 2) make the column unique, and catch DB exceptions thrown from constraint validations.
In short, you have to do something in concert with the database to determine whether it's actually unique in the database. With a pool of less than a million, you're likely to get collisions quite often.
It's worth mentioning, as @PeterO points out, this isn't going to be remotely secure. It would be trivially easy to brute force a collision from a pool of less than a million candidates. However, using cryptographic RNG isn't going to help here if you're still ending up with a 6-character numeric. How you get a random number doesn't matter as much as the how random that number can actually be. The entropy here is next to zero.