You have to call the
Substring
method on all the components of the employe id.
string nam = tbUname.Text;
string dep = tbdept.Text;
string con = tbContact.Text;
nam = nam.Substring(nam.Length-2);
dep = dep.Substring(dep.Length-2);
con = con.Substring(con.Length-2);
cmd.Parameters.AddWithValue("@Emp_id", nam+dep+con);