If you want to go this route, here's how I have SQL Server generate a RowID for me..
1. Use a Stored Procedure to add the new row
2. Use a parameter in the sproc to return the identit
DECLARE @NewRowID int OUTPU
3. Immediately after the INSERT and error check (if applicable), set @NewRowID to the identit
SET @NewRowID = Scope_Identity(
4. In your vb code, set the direction of the parameter to Output..
prmNewRowID.Direction = ParameterDirection.Outpu
5. After executing the sproc, retrieve the value from SQLCommand.Parameter
RowIDVariable = CInt(SQLCommand.Parameters("@NewRowID").Value
I think this is the best way to let SQL Server sort out unique numbers for records. It's very common in multi-user applications for the user to execute a transaction and then receive a unique number back from the database in this fashion
I hope this helps, it seems it would be nicer to have Customer #12345 rather than Customer #{D579116A-EE83-4fb0-BB87-72AF7E509088}. :-
Best Regards
Mark Lauser - Crimson Softwar