Assuming you mean Auto Generated ID, here are some steps you might want to take.
1. Add an output parameter using
AddOutParameter[
^]
2. Modify the query and assign the auto generated ID to the parameter you have created.
3. After db.ExecuteNonQuery(cmd), get the value of the output parameter by using
GetParameterValue[
^] and then assign it to your textbox.