if your insert statement is in your code, you can use ;SELECT SCOPE_IDENTITY after your insert statement, this will return the last identity value that you inserted..
simple enough to run another select statement from this to print out the last record.
http://msdn.microsoft.com/en-us/library/ms190315.aspx[
^]
string sqlInsertActivity = "INSERT INTO activity (CodeID, Subject, ActivityPriorityID, CreatedByEmployeeID, AssignmentTaskStatusID) "
+ "VALUES('82', 'New Document', '2', '" + createdBy + "', '2') "
+ ";SELECT SCOPE_IDENTITY();";
string activityID = SqlHelper.ExecuteScalar(conn, CommandType.Text, sqlInsertActivity).ToString();
a quick example above of one I did which inserts a row into a table and returns the id of the record just inserted