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

Dotnet Discussion :

Visual studio et access


Sujet :

Dotnet

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Drilling enginer
    Inscrit en
    Décembre 2015
    Messages
    123
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 66
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Drilling enginer
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2015
    Messages : 123
    Par défaut Visual studio et access
    Bonjour,

    Je ne sais pas si je suis sur le bon forum, donc n'hésitez pas a me reprendre. Mon problème: j'ai un fichier excess de 12 colonnes et 80 lignes, j'ai fais une form visual studio en vb.net a laquelle j'ai associé ma base de donnée en mdb pour eviter les pbs de ole12 etc...
    jusqu'a la tout va bien, j'affiche une datagridview dans laquelle je voudrais récupéré des datas en fct de 2 combobox... et la ça coince car la seule valeur que je récupère,c'est celle de la première ligne, la colonne est bonne mais pas la ligne ... je mets mon code pour vous donner une idée.
    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
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    Public Class Form1
        Dim OD_inches As String
        Dim weight As String
        Dim sql As String
        Dim vol_int As String
        Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
     
        End Sub
     
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'TODO: cette ligne de code charge les données dans la table 'CsgDataSet1.Csg_datas'. Vous pouvez la déplacer ou la supprimer selon les besoins.
            Me.Csg_datasTableAdapter.Fill(Me.CsgDataSet1.Csg_datas)
     
        End Sub
     
        Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
     
            If ComboBox1.Text = "4 1/2" Then
                ComboBox2.Items.AddRange(New Object() {"9.5", "10.5", "11.6", "13.5", "15.1", "16.9", "17.7", "18.8"})
            End If
     
            If ComboBox1.Text = "5" Then
                ComboBox2.Items.AddRange(New Object() {"11.5", "13", "15", "18", "10.8"})
            End If
     
            If ComboBox1.Text = "5 1/2" Then
                ComboBox2.Items.AddRange(New Object() {"14", "15.5", "17", "20", "23"})
            End If
     
            If ComboBox1.Text = "6 5/8" Then
                ComboBox2.Items.AddRange(New Object() {"20", "24", "28", "32"})
            End If
     
            If ComboBox1.Text = "7" Then
                ComboBox2.Items.AddRange(New Object() {"17", "20", "23", "26", "29", "32", "35", "38", "41", "44"})
            End If
     
            If ComboBox1.Text = "7 5/8" Then
                ComboBox2.Items.AddRange(New Object() {"24", "26.4", "29.7", "33.7", "39", "55.3"})
            End If
     
            If ComboBox1.Text = "8 5/8" Then
                ComboBox2.Items.AddRange(New Object() {"24", "28", "32", "36", "40", "44", "49"})
            End If
     
            If ComboBox1.Text = "9 5/8" Then
                ComboBox2.Items.AddRange(New Object() {"32.3", "36", "40", "43.5", "47", "53.5", "58.4", "61.1", "71.8"})
            End If
     
            If ComboBox1.Text = "10 3/4" Then
                ComboBox2.Items.AddRange(New Object() {"32.75", "40.5", "45.5", "51", "55.5", "60.7", "65.7"})
            End If
     
            If ComboBox1.Text = "11 3/4" Then
                ComboBox2.Items.AddRange(New Object() {"42", "47", "54", "60"})
            End If
     
            If ComboBox1.Text = "13 3/8" Then
                ComboBox2.Items.AddRange(New Object() {"48", "54.5", "61", "68", "72"})
            End If
     
            If ComboBox1.Text = "16" Then
                ComboBox2.Items.AddRange(New Object() {"65", "75", "84"})
            End If
     
            If ComboBox1.Text = "18 5/8" Then
                ComboBox2.Items.AddRange(New Object() {"87.5"})
            End If
     
            If ComboBox1.Text = "20" Then
                ComboBox2.Items.AddRange(New Object() {"94", "106.5", "133"})
            End If
     
            If ComboBox1.Text = "24" Then
                ComboBox2.Items.AddRange(New Object() {"87,5"})
            End If
     
     
     
        End Sub
     
     
     
        Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
     
            TextBox1.Text = ComboBox1.Text
            TextBox2.Text = ComboBox2.Text
            OD_inches = TextBox1.Text
            weight = TextBox2.Text
     
     
            sql = "SELECT vol_int FROM Csg_datas WHERE OD_inches =  '" & OD_inches & "'   and weight =  " & weight & ""
     
            vol_int = DataGridView1.Rows(vol_int).Cells(10).Value.ToString
     
            TextBox3.Text = vol_int
        End Sub
     
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Application.Exit()
     
        End Sub
    End Class

  2. #2
    Membre confirmé
    Homme Profil pro
    Drilling enginer
    Inscrit en
    Décembre 2015
    Messages
    123
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 66
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Drilling enginer
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2015
    Messages : 123
    Par défaut personne pour m'aider
    bonjour,

    personne pour m'aider ?, car je galère depuis plusieurs jours

  3. #3
    Expert confirmé

    Homme Profil pro
    consultant développeur
    Inscrit en
    Mai 2005
    Messages
    3 040
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : consultant développeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 040
    Par défaut
    Comme tu le pressens, ce n'est pas le bon forum.
    Vois plutôt avec le forum Visual Studio
    ou mieux avec le forum Visual basic Net
    https://dotnet.developpez.com/vbnet/

  4. #4
    Expert confirmé
    Avatar de Mat.M
    Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2006
    Messages
    8 539
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2006
    Messages : 8 539
    Par défaut
    Salut Pierre il faut tester la requête dans le requêteur d'Access et voir si la requête SQL ramène toutes les lignes.
    Sinon il ne devrait pas y avoir de problèmes si le projet incorpore les bons objets.
    Sinon dans Visual Studio il y a aussi l'Entity Framework mais perso je ne suis pas très favorable à l'utilisation de cet outil.
    C'est plus simple de faire des requêtes SQL avec le bon connecteur.

  5. #5
    Expert éminent
    Avatar de tee_grandbois
    Homme Profil pro
    retraité
    Inscrit en
    Novembre 2004
    Messages
    8 960
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : retraité

    Informations forums :
    Inscription : Novembre 2004
    Messages : 8 960
    Par défaut
    bonsoir,
    j'ai un fichier excess de 12 colonnes et 80 lignes,
    s'agit-il d'un fichier Accel ou Excess ?

  6. #6
    Expert confirmé
    Avatar de Mat.M
    Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2006
    Messages
    8 539
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2006
    Messages : 8 539
    Par défaut
    oui c'est vrai que ça porte à confusion

Discussions similaires

  1. [C#][Silverlight][Visual Studio 2010] Access a mysql
    Par cescu dans le forum Accès aux données
    Réponses: 8
    Dernier message: 22/04/2011, 17h57
  2. visual studio 2008 et mise a jour bdd access
    Par clem44nantes dans le forum C#
    Réponses: 2
    Dernier message: 30/11/2009, 16h05
  3. connection d'un BD access avec visual studio 2008
    Par bmithoun dans le forum VB.NET
    Réponses: 1
    Dernier message: 20/07/2008, 07h54
  4. [Visual Web] [Studio creator] Access
    Par helix_tp dans le forum NetBeans
    Réponses: 2
    Dernier message: 22/03/2006, 19h35
  5. Réponses: 5
    Dernier message: 29/09/2005, 15h49

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