I suspect the problem is to do with the content of one or more text boxes.
Change your code: Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead. That will also probably fix your problem, and make your code considerably easier to read...
com.CommandText="UPDATE joining SET aname = @NAME,fathname=@FATHER,dob=@DOB..."
com.Parameters.AddWithValue("@NAME",txtName.Text.Trim());
com.Parameters.AddWithValue("@NAME",txtFather.Text.Trim());
com.Parameters.AddWithValue("@NAME",txtDOB.Text.Trim());
...
try{int count=com.ExecuteNonQuery();