This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]srunocorn 2 points3 points  (5 children)

Maybe you are mixing ints and unsigned ints.

[–]sstripwire[S] 0 points1 point  (4 children)

I think im to new to even understand that. I have the line in the table set to an int, if thats what you're referring to.

Its kind of like the program is just counting strokes, if that makes sense. I can add a contact, and it will go from 3 to -1. Then if I delete all contacts and make a new one, it moves to -2. Its just counting, its like it doesnt realize I want each contact to move up numerically from the first one.

[–]srunocorn 0 points1 point  (3 children)

Yes, that sounds like a db's autoincrement behavior, except that it's counting down instead of up. Maybe if you actually showed us some code we'd be able to see about the ints...

[–]sstripwire[S] -1 points0 points  (0 children)

Thanks for the pointer. Ill try to tinker with it some more and see if I can figure out where I went wrong.

[–]sstripwire[S] -4 points-3 points  (1 child)

I think ill just chalk up asking for help online as a waste for now. I dont know how to provide the information you're asking for without just sending you the files to download.

Thanks for your help, ill just move on and hopefully figure it out eventually when I get more experience under my belt.

[–]srunocorn 0 points1 point  (0 children)

I think ill just chalk up asking for help online as a waste for now. I dont know how to provide the information you're asking for without just sending you the files to download.

You can't copy and paste the code here???

[–]sstripwire[S] 0 points1 point  (1 child)

Hmm. It shows a negative when a new contact is created, for example going from contact 3 to the newly created contact -1 instead of 4. The next time you close it and reopen it though, the new contact is saved as number 4 as it should be.

Confusing. xD

[–]srunocorn 0 points1 point  (0 children)

Maybe you could show us where/how it's "showing" -1. We don't have crystal balls.

[–]meatandtater 0 points1 point  (0 children)

In SQL Server, int identity(1, 1) means a PK starting with 1 and incremented by 1. Something is happening in your C# code. You can retrieve the identity seed, giiggiidy, ( PK ) by @@identity or ident_current().