Mitmit

Hi

Im doing a program that uses a table where i have a primary key. I have a field that is a unic number that is generated everytime i create a new post.

This seem to work in the databasetabel. I can see them. I can also delete them and that is working.
But in my program i have a textfiled that should show the unic number that is connected to the field. The problem is that it seems that when i generate a dataset it show my unic field "ArchiveID" as 1,2,3,4,5,6,7 and soo on.

But in the database the ArchiveID for the post can be 3,4,7,9,23 and so on because i have deleted some posts. So it seem that my database have another unic id then my database.

Hope you understand, please ask otherwise so i can try to explane more.

Mitmit



Re: .NET Framework Data Access and Storage Dataset dont show the right number from the database

Caddre

What you are getting is normal because you can use Scope_IDENTITY to return the current value to you and you can use DBCC CHECKIDENT to reset the value of the column. Try the link below for details.

http://msdn2.microsoft.com/en-us/library/ms190315.aspx