Please, don't do it that way.
That is a major recipe for an SQL Injection attack - use Parametrized queries instead:
str = "INSERT INTO template (tname,tdob,tsex,tmo,tmail,tcity,tpin,tst,tco,tca,tskill,tedu,ttrain,texpt,tproj,texp,tint) VALUES (@tname,@tdob,@tsex,@tmo...
cmd.Parameters.AddWithValue("@tname",TextBox1.Text.Trim())
cmd.Parameters.AddWithValue("@tdob",TextBox2.Text.Trim())
...
In addition, rename your controls: you may remember that TextBox7 is the "pin" today - but you won't next week. Call it something related to it's usage!
Then, you can add a check for null values to your parameter stting, and feed DBNull.Value to the database instaed, which will cure your problem.