I am executing a Non query SQL. I will like to know where we go in Visual studio 2013 to see the SQL generated and the error code.
string cmdText = "UPDATE RendezVous SET
nomClientEssai=@nomClientEssai,prenomClientEssai=@prenomClientEssai,
IsAvailable=@IsAvailable WHERE rdvId=@rdvId";
SqlCommand cmd = new SqlCommand(cmdText, con);
cmd.Parameters.AddWithValue("@nomClientEssai", Convert.ToString(Session["nom"]));
cmd.Parameters.AddWithValue("@prenomClientEssai", Convert.ToString(Session["prenom"]));
cmd.Parameters.AddWithValue("@IsAvailable", "False");
cmd.Parameters.AddWithValue("@rdvId", cleRdvId);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd.ExecuteNonQuery(); <=== I want to see the sql return code here !!!
con.Close();
This SQL is not updating my table and I want to know why and know how I can verify the SQL statement and also the SQL return code. I don't have any error generated but nothing is getting updated.
cmdText. Parameters make it to the SQL server intact.rdvId=@rdvIdmatches nothing, so nothing is updated. Can you verify this is correct?