What I try to do is capture the last code that was entered from my table in sql and show it in my txt that is in c # try with this code but it did not work for me I hope your help
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
SqlCommand com = new SqlCommand("select Nro_Pedido from pedido where nro_pedido= (select @@IDENTITY)", con);
con.Open();
SqlDataReader nro = com.ExecuteReader();
if (nro.Read())
{
txtnum_ped.Text = nro["Nro_pedido"].ToString();
}
con.Close();