IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

Afficher les informations concernant le nom du client quand je tape son nom


Sujet :

Windows Forms

  1. #1
    Membre habitué Avatar de zangaloni
    Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    474
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 474
    Points : 151
    Points
    151
    Par défaut Afficher les informations concernant le nom du client quand je tape son nom
    Bonjour,
    je me trouve coincé avec cette methode je poste le code ..je cherche à comprendre ce quel fait cette methode..sachant que je cherche à afficher les informations sur ma base qui concerne le nom du client que je tape son nom
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
     
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Dim NOMcli As String
     
            NOMcli = TextBox20.Text
            rechercheclient(NOMcli)
            DataGrid1.SetDataBinding(DataSetresultatrecherche2, "Tclient")
        End Sub
        Public Function recherche(ByVal dataadapter As OleDb.OleDbDataAdapter, ByVal nomtable As String, ByVal champs As String, ByVal parametres As OleDb.OleDbParameter()) As DataTable
            Dim derniereErreur As String
            Dim separateur As String
            If nomtable.IndexOf("where") > 1 Then
                separateur = "and"
            Else
                separateur = "where"
            End If
            Try
                MsgBox("recherche" & nomtable)
                recherche = New DataTable(nomtable)
                MsgBox("recherche" & nomtable)
                dataadapter.SelectCommand.CommandText = "select" + champs + "from" + nomtable
                dataadapter.SelectCommand.Parameters.Clear()
                Dim parametre As OleDb.OleDbParameter
                For Each parametre In parametres
                    If parametre.Value <> Nothing Then
                        MsgBox("paramname" & parametre.ParameterName)
                        dataadapter.SelectCommand.CommandText = dataadapter.SelectCommand.CommandText + separateur + parametre.ParameterName + "=?"
                        dataadapter.SelectCommand.Parameters.Add(parametre)
                        separateur = "and"
                    End If
                Next
                DataSetresultatrecherche2 = New DataSet()
                DataSetresultatrecherche2.Tables.Add(recherche)
                dataadapter.Fill(recherche)
                derniereErreur = ""
            Catch except As Exception
                recherche = Nothing
                derniereErreur = except.Message
            End Try
        End Function
        Public Function rechercheclient(ByVal nomcli As String) As DataTable
     
            rechercheclient = recherche(OleDbDataAdapter1, "Tclient", "Numclt,Nomclt,Adrclt,Vilclt,Telclt", New OleDb.OleDbParameter() {New System.Data.OleDb.OleDbParameter("Nomclt", nomcli)})
        End Function

  2. #2
    Membre régulier
    Inscrit en
    Avril 2009
    Messages
    99
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 99
    Points : 119
    Points
    119
    Par défaut
    Salut,

    Pourquoi tu ne regardes pas en mode pas à pas ce qui se passe précisement ? Ça peut t'aider pour commencer...

  3. #3
    Membre habitué Avatar de zangaloni
    Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    474
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 474
    Points : 151
    Points
    151
    Par défaut
    comment faire pour travailler avec ce mode ?

  4. #4
    Expert éminent
    Avatar de StormimOn
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2005
    Messages
    2 593
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Sarthe (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 2 593
    Points : 7 660
    Points
    7 660
    Par défaut
    En se servant du débogage : Débogage dans Visual Studio
    Pas de questions techniques par MP

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 13
    Dernier message: 24/09/2010, 15h41
  2. [AJAX] Liste déroulante pour afficher les informations en ajax div ?
    Par rob2-9 dans le forum Général JavaScript
    Réponses: 13
    Dernier message: 17/11/2006, 09h06
  3. afficher les informations texte depuis mysql
    Par arti2004 dans le forum SQL Procédural
    Réponses: 2
    Dernier message: 26/02/2006, 16h54
  4. Afficher les informations du système
    Par orisis dans le forum Windows
    Réponses: 8
    Dernier message: 10/06/2004, 15h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo