sql server command to increment row value





sqlcommand cmd=new sqlcommand="select isnull max((id,0)+1) from tablename,con";
int id=(int) cmd.executescalar();


for example student id create from 1

next come 2,3,4,5,6.....................