Here is my code

Dim i As Integer
        Dim arrList As ArrayList
        If Session("Cart") Is Nothing Then
            arrList = New ArrayList()
        Else
            arrList = CType(Session("Cart"), ArrayList)
            Session("cart") = arrList

            Label1.Text = arrList.Count
        End If
        Dim s = arrList.Count
        For i = 0 To s - 1
            Dim dvdid As Integer
            dvdid = arrList.Item(i)
            Dim dt As New DataTable
           Dim dr As DataRow = dt.NewRow()
          
            dt = checkoutAdapter.GetCheckout(dvdid)
            ds.Tables.Add(dt)
            CheckoutGridView.DataSource = checkoutAdapter.GetCheckout(dvdid)
            CheckoutGridView.DataBind()


        Next

Here the datagridview shows only one row
I want the display all the values passsed through the loop

I crated checkout adapter using the query on a datatable.

please help me

it is natural that it is going to have one row because you are setting the datasource and calling the databind method in the loop, each time loop iterates it binds the next row. to solve the problem you have to put those two lines right after the next statement. basically move these two lines
CheckoutGridView.DataSource = checkoutAdapter.GetCheckout(dvdid)
CheckoutGridView.DataBind()
after the next statement.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.