_command.CommandText "SELECT numero, matricule FROM annuaire_new WHERE login" + login; DbDataReader reader = _command.ExecuteReader(); if(reader.Read()) // S'il y a au moins une ligne { Demandeur = reader["numero"].ToString(); Matricule = reader["matricule"].ToString(); }
_command.CommandText = "SELECT numero, matricule INTO @Numero, @Matricule FROM ..."; SqlParameter num = new SqlParameter("@Numero", SqlDbType.VarChar); num.Direction = ParameterDirection.Output; SqlParameter mat = new SqlParameter("@Matricule", SqlDbType.VarChar); mat.Direction = ParameterDirection.Output; _command.Parameters.Add(num); _command.Parameters.Add(mat); _command.ExcuteReader(); Demandeur = num.Value; Matricule = mat.Value;
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question