bonjour,
je débute en asp.net et sql server
j'ai chercher comment afficher les données dans une Label et j'ai trouvé ça:
j'aimerai juste savoir qu'est ce que c'est titi @tutu ( pourquoi on ajoute @ ) et SqlDbType.NVarchar
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 using(SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LaConnectionStringConfigureeDansLeWeb.Config"].ConnectionString)) using( SqlCommand command = new SqlCommand("select toto from tata where titi @tutu", conn){ command.Parameters.Add("@tutu", SqlDbType.NVarchar).Value = "tsointsoin"; conn.open(); monLabel.Text = (String)command.ExecuteScalar(); conn.close();
merci
Partager