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

ASP.NET Discussion :

Problème de Panier


Sujet :

ASP.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2009
    Messages : 36
    Par défaut Problème de Panier
    Bonjour,
    j'ai créé un site en aspnet avec une commande mais il y a une erreur dans mon code vb de la page panier et je n'arrive pas à la résoudre.
    pouvez-vous m'aider svp?
    merci d'avance

    voici le code de la page vb
    mon erreur se trouve dans le 1er while au niveau de ce code sur "Paniercds"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    MyAdap.Fill(MyData, "Paniercds")
    l'erreur est
    Aucune valeur donnée pour un ou plusieurs objets requis.
    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
     
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Session("NbArticle") = 0 Then
                MsgBox("Votre panier est vide. Sélectionnez vos articles !!!")
                Response.Redirect("ProduitType.aspx")
            End If
     
            Dim suppnl As String
            suppnl = Request.QueryString("Effnl")
            If suppnl <> "" Then
                'Pour le premier passage
                Dim i As Integer
                i = CInt(suppnl)
                Do While i < Session("NbArticle")
                    Session(Str(i)) = Session(Str(i + 1))
                    i = i + 1
                Loop
                Session(Str(i)) = ""
                Session("NbArticle") = Session("NbArticle") - 1
                If Session("NbArticle") = 0 Then Response.Redirect("ProduitType.aspx")
            End If
     
            Dim MyConn As OleDbConnection
            Dim MyAdap As OleDbDataAdapter
            Dim MyData As DataSet
            MyConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("App_Data/bdd_aspnet.mdb") & ";")
            MyConn.Open()
            MyData = New DataSet()
            Dim cpt As Integer
            cpt = 1
            While cpt <= CLng(Session("NbArticle"))
                MyAdap = New OleDbDataAdapter("Select * From T_Produit Where Ref Like " & CLng(Session(Str(cpt))), MyConn)
                MyAdap.Fill(MyData, "Paniercds")
                cpt = cpt + 1
            End While
            ' Mettons en page le panier en mode déconnecté
            Session("total") = 0
     
            'Mep en-tête panier
            Dim mRowHead As New TableRow()
     
            Dim mCellHeader As New TableHeaderCell()
            mCellHeader.Text = "Numéro ligne"
            'on souhaite que le texte soit centré horizontalement
            mCellHeader.HorizontalAlign = HorizontalAlign.Center
            mRowHead.Cells.Add(mCellHeader)
     
            mCellHeader = New TableHeaderCell()
            mCellHeader.Text = "N°Produit"
     
            mCellHeader.HorizontalAlign = HorizontalAlign.Center
            mRowHead.Cells.Add(mCellHeader)
     
            mCellHeader = New TableHeaderCell()
            mCellHeader.Text = "Libellé"
            mCellHeader.HorizontalAlign = HorizontalAlign.Left
            mRowHead.Cells.Add(mCellHeader)
     
            mCellHeader = New TableHeaderCell()
            mCellHeader.Text = "PU"
            mCellHeader.HorizontalAlign = HorizontalAlign.Left
            mRowHead.Cells.Add(mCellHeader)
     
            mCellHeader = New TableHeaderCell()
            mCellHeader.Text = "URL"
            mCellHeader.HorizontalAlign = HorizontalAlign.Right
            mRowHead.Cells.Add(mCellHeader)
     
            mCellHeader = New TableHeaderCell()
            mCellHeader.Text = "Annuler un article"
            mCellHeader.HorizontalAlign = HorizontalAlign.Center
            mRowHead.Cells.Add(mCellHeader)
            mTable.Rows.Add(mRowHead)
     
            'Mep corps panier
            Dim j As Integer = 1
            Dim row As DataRow = MyData.Tables("Paniercds").Rows(0)
            For Each row In MyData.Tables("Paniercds").Rows
                Dim mRow As New TableRow()
                Dim mCell As New TableCell()
     
                mCell = New TableCell()
                mCellHeader.ID = Str(j)
                mCell.Text = Str(j)
                mCell.HorizontalAlign = HorizontalAlign.Center
                mRow.Cells.Add(mCell)
     
                mCell = New TableCell()
                mCell.Text = row(0).ToString()
                mCell.HorizontalAlign = HorizontalAlign.Center
                mRow.Cells.Add(mCell)
     
                mCell = New TableCell()
                mCell.Text = row(1).ToString()
                mCell.HorizontalAlign = HorizontalAlign.Left
                mRow.Cells.Add(mCell)
     
                mCell = New TableCell()
                mCell.Text = row(2).ToString()
                mCell.HorizontalAlign = HorizontalAlign.Left
                mRow.Cells.Add(mCell)
     
                mCell = New TableCell()
                mCell.Text = row(3).ToString()
                Session("total") = Session("total") + CInt(row(3).ToString())
                mCell.HorizontalAlign = HorizontalAlign.Center
                mRow.Cells.Add(mCell)
     
                mCell = New TableCell()
                Dim mHyper As New HyperLink()
                mHyper.NavigateUrl = "Panier.aspx?Effnl=" + Str(j)
                mHyper.Text = "Effacer"
                mCell.HorizontalAlign = WebControls.HorizontalAlign.Center
                mCell.Controls.Add(mHyper)
                mRow.Cells.Add(mCell)
                j = j + 1
                mTable.Rows.Add(mRow)
            Next
     
            MyData.Dispose()
            MyData.Clear()
            MyConn.Close()
     
            'Mep pied panier
            Dim mRowfoot As New TableRow()
            Dim mCellFooter As New TableCell
            mCellFooter.Text = "Votre Total"
            'on souhaite que le texte soit centré horizontalement
            mCellFooter.HorizontalAlign = HorizontalAlign.Center
            mRowfoot.Cells.Add(mCellFooter)
     
            mCellFooter = New TableCell()
            mCellFooter.Text = ""
            mCellFooter.HorizontalAlign = HorizontalAlign.Center
            mRowfoot.Cells.Add(mCellFooter)
     
            mCellFooter = New TableCell()
            mCellFooter.Text = ""
            mCellFooter.HorizontalAlign = HorizontalAlign.Left
            mRowfoot.Cells.Add(mCellFooter)
     
            mCellFooter = New TableCell()
            mCellFooter.Text = ""
            mCellFooter.HorizontalAlign = HorizontalAlign.Left
            mRowfoot.Cells.Add(mCellFooter)
     
            mCellFooter = New TableCell()
            mCellFooter.Text = Session("total")
            mCellFooter.HorizontalAlign = HorizontalAlign.Center
            mRowfoot.Cells.Add(mCellFooter)
     
            mCellFooter = New TableCell()
            mCellFooter.Text = "Euros"
            mCellFooter.HorizontalAlign = HorizontalAlign.Center
            mRowfoot.Cells.Add(mCellFooter)
            mTable.Rows.Add(mRowfoot)
        End Sub

  2. #2
    Rédacteur
    Avatar de lutecefalco
    Profil pro
    zadzdzddzdzd
    Inscrit en
    Juillet 2005
    Messages
    5 052
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : zadzdzddzdzd

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 052
    Par défaut
    Et on est censé trouver le problème tout seul?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2009
    Messages : 36
    Par défaut
    désolé, ma page internet s'était fermée avant que j'ai fini

    pouvez-vous m'aider svp?

Discussions similaires

  1. [PrestaShop] Probléme de panier qui disparait
    Par sizedbaloo dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 0
    Dernier message: 14/01/2014, 12h39
  2. problème de panier
    Par ph_anrys dans le forum Langage
    Réponses: 1
    Dernier message: 01/03/2011, 16h28
  3. [MySQL] Problèmes de panier
    Par jeremdu94 dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 29/04/2008, 17h08
  4. session problème quantité panier
    Par kitty2006 dans le forum Langage
    Réponses: 7
    Dernier message: 31/08/2006, 19h24
  5. Problème de panier virtuel
    Par zourk dans le forum Langage
    Réponses: 1
    Dernier message: 29/08/2006, 13h41

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