Comment créer un bulletin comme Etat avec parametre

Debord10 Messages postés 45 Date d'inscription mercredi 23 mars 2011 Statut Membre Dernière intervention 7 juin 2013 - 9 mars 2012 à 09:51
Debord10 Messages postés 45 Date d'inscription mercredi 23 mars 2011 Statut Membre Dernière intervention 7 juin 2013 - 9 mars 2012 à 16:41
Bonjour!

Je demande à toute personne qui peut m'aider à résoudre mon problème. Au fait je voudrai créer un Etat bulletin qui s'affiche après que l'utilisateur ait donné en parametre le matricule et le semestre, si quelque a une idée sur le comment faire, vraiment prière de m'aider à m'en sortir.
Voilà ma proposition du code, qui quand j’exécute, il m'envoi un message disant"l'opérateur & n'est pas defini pour chaine Select Etudiant.MatEtu as [Matricule Etudiant] et de type Datarowview ":

'Chaîne de connexion
Dim connectString As String = "Data Source=SWEET-A6BD9BF37;Initial Catalog=GESCOBASE;Integrated Security=True"
'Objet connection
Dim connection As SqlConnection = New SqlConnection(connectString)
'Ouverture
connection.Open()
'Objet Command
Dim command As SqlCommand = New SqlCommand("SELECT ETUDIANT.MATETU as [Matricule Etudiant], ETUDIANT.NOMETU as [Nom Etudiant], ETUDIANT.PREETU as [Prénom Etudiant],TELETU as Téléphone,SEXE as Sexe,NATETU as Nationalité,ETUDIANT.CODFIL as [Code Filière],LIBFIL as [Libellé Filière],EVALUER.CODMAT as [Code Matière], LIBMAT as [Libellé Matière], COEF_MAT as Coéfficient, AVG(NOTE) AS [Note évaluation],EVALUER.CODTYPEVA as [Code évaluation],SEME as SEMESTRE,DEBSEME as [Debut Semestre],FINSEME as [FIN Semestre]FROM(Filiere, Enseigner, Matiere, Etudiant, Evaluer, TypeEvaluation)where" + " SEME='" & SEMESTREComboBox.SelectedItem & "'and Etudiant.MatEtu='" & Matricule_EtudiantComboBox.SelectedItem & "' and EVALUER.CODMAT=MATIERE.CODMAT and ENSEIGNER.CODFIL=FILIERE.CODFIL and ENSEIGNER.CODMAT=MATIERE.CODMAT and FILIERE.CODFIL=ETUDIANT.CODFIL and EVALUER.MATETU=ETUDIANT.MATETU And DATEVA Between DEBTRIME And FINTRIME GROUP BY ETUDIANT.MATETU,NOMETU,PREETU,TELETU,SEXE,NATETU,ETUDIANT.CODFIL,LIBFIL,EVALUER.CODMAT,EVALUER.CODTYPEVA, LIBMAT , COEF_MAT,TRIME,DEBTRIME,FINTRIME", connection)
'Paramètres
command.Parameters.Add(New SqlParameter(SEMESTREComboBox.SelectedValue, SqlDbType.VarChar, 10))
command.Parameters(SEMESTREComboBox.SelectedValue).Value = "SEME"
command.Parameters.Add(New SqlParameter(Matricule_EtudiantComboBox.SelectedValue, SqlDbType.VarChar, 6))
command.Parameters(Matricule_EtudiantComboBox.SelectedValue).Value = "MatEtu"
'Object datareader
Dim reader As SqlDataReader = command.ExecuteReader()
Dim row As Object()
While reader.Read()

If row Is Nothing Then
row = New Object(reader.FieldCount - 1) {}
End If
reader.GetValues(row)
For i As Integer = 0 To row.GetLength(0) - 1
If Not row(i) Is DBNull.Value Then
Console.Write(row(i))
Else
Console.Write("NULL")
End If
If i < row.GetUpperBound(0) Then
Console.Write(" | ")
End If
Next
Console.WriteLine()
End While
Bulletin.Show()
'Fermeture reader
reader.Close()
'Fermeture base
connection.Close()

Je remercis à tout celui qui sera disposé à m'aider.

1 réponse

Debord10 Messages postés 45 Date d'inscription mercredi 23 mars 2011 Statut Membre Dernière intervention 7 juin 2013
9 mars 2012 à 16:41
Salut!

SVP les amis j'ai fouillé dans les codes existants je n'ai pas trouvé.
Pour précision c'est le code Visual basic.net 2008, alors que les codes que trouve sont ceux de VB6. Aider moi suis vraiment coincé.
0
Rejoignez-nous