There are various ways of getting identity value in C# and VB .Net, this can be done using code or sql server stored procedure.
Here is a complete article about Getting the identity of the most recently added record