You have NO Connection on cmd the second time around:
cmd = new SqlCommand("INSERT INTO [info] (kod,name,family,tel,shahr,mantaghe) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')");
Should be:
cmd = new SqlCommand("INSERT INTO [info] (kod,name,family,tel,shahr,mantaghe) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')",con);
notice that con was added...
But anyhow, this will NOT Work, as you change the cmd, the while loop will throw an exception, I think.
SqlCommand cmdInsert = new SqlCommand("INSERT INTO [info] (kod,name,family,tel,shahr,mantaghe) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')",con);
cmdInsert.ExecuteNonQuery();
And Again, this is not recommended, use SqlParameter to pass the informations from all the textboxes.