What I need is that when a user types a code in a textbox, "appears" the name related to that code in a label.
In the click event of my save button try with this code but do not do it, until the entire saving process finishes. And what I need is for you to show it and then save it.
//Agregar el nuevo codigo
SqlCommand cmd = new SqlCommand("Insert into tabla1 (...) VALUES(@cod...)", con);
cmd.Parameters.Add("@cod", SqlDbType.VarChar).Value = codigo.Text;
.
.
.
cmd.ExecuteNonQuery();
//aqui busco el nombre relacionado al codigo ingresado
SqlCommand cmd2 = new SqlCommand("Select Nombre from tabla2 where Cod='" + codigo.Text + "'", con);
cmd2.ExecuteNonQuery();
label3.Text = Convert.ToString(cmd2.ExecuteScalar());
Thread.Sleep(10000);
Thanks for reading.