Answer 1
The best answer could depend on how you are doing your data access, as there are a few different ways it can be accomplished.
Does your table in the SQL Server have an ID field that is set to identity?
Answer 2
Duplicate post.