Apr 8, 2010

Return identity column value

create table with identity column..
then in stored procedure create output parameter
at the end of stored procedure
assign output parameter to scope_identity()
ex:set @id=scope_identity()
return id

it returns the identity value.
in c#.net use the executescalar command object.

Apr 1, 2010

disable browswer back button

after logout disable browser back button


Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();

place the code in page load...